Skip to content

Releases

v2.0.0a2

v2.0.0a2 Pre-release
Pre-release

Choose a tag to compare

@veyga veyga released this 21 Sep 03:17
ae858ce

funstruct v2.0.0a2 — Pure Typeclass Architecture

Major architectural overhaul. Data types are pure data; all behavior lives on typeclass instances.

Architecture

  • HKTMeta metaclass — class-level typeclass dispatch (Option.pure, Result.do, Option.empty)
  • DotNotation — instance-level dispatch (Some(10).bind(f), Ok(10).map(f))
  • @final sealed variants — Ok, Err, Some, Nothing, etc. can't be subclassed
  • @dataclass(frozen=True, eq=False, repr=False) — no auto-generated dunders

Typeclasses (15)

Functor, Applicative, Monad, MonadError, Alternative, Bifunctor, Foldable, Traversable, Semigroup, Monoid, Eq, Representable, Stringable, Truthable

Do-notation

  • AST-based do (experimental) — compiles yield to bind/map chains, works for CList
  • Generator-based do (default) — works for all monads except CList

Breaking Changes

  • Imports moved: funstruct.monad.* → funstruct.types.*
  • pure, raise_error, empty removed from data types — use HKTMeta dispatch
  • bind, handle_error_with, bimap, left_map removed from data type variants — on instances
  • __eq__, __repr__, __bool__, __hash__ removed from variants — via Eq/Representable/Truthable
  • Semigroup/Monoid changed from dataclasses to ABCs
  • from_result/from_either removed from AsyncResult

v2.0.0-alpha1

v2.0.0-alpha1 Pre-release
Pre-release

Choose a tag to compare

@veyga veyga released this 06 Sep 21:41
ec5060e

v2.0.0-alpha1

Architecture (breaking change from v1)

  • Separated data types from typeclass instances — data types extend DataType, not typeclasses
  • summon(Monad, Option) — typeclass instance resolution via registry
  • DotNotation mixin — Some(10).map(f) delegates to summon internally
  • for_type= auto-registration — class _OptionMonad(Monad, for_type=Option)
  • BaseTypeclass — root of all typeclasses with AutoRegister
  • TypeConstructor — auto _type_constructor detection
  • tc_of(value) — Haskell-style automatic type constructor resolution

New typeclasses

  • Bifunctor, Alternative, MonadError, Foldable, Traversable

New features

  • Optics (lenses): at('key') >> at('nested')
  • frozendict.to_dict() + JSON round-trip
  • frozendict deep-freeze by default
  • Writer.for_monoid() factory
  • Auto-generated typeclass hierarchy SVG
  • Browser playground (PyScript/Pyodide)
  • 11 guides, 18 demo scripts, 57 benchmarks

v1.0.2

Choose a tag to compare

@veyga veyga released this 31 Aug 23:39
5cecade

Fix Result type preservation for downstream clients.

  • Result is now abstract with map, bind, alt, or_else returning Result
  • Ok/Err override all methods to stay in Result land (no degradation to Either)
  • TryAsync overloads for correct async function inference
  • Validated.__add__ returns Validated (not Applicative)
  • Abstract to_result/to_result_or on Validated base

Downstream clients no longer need any ty suppressions.

v1.0.1

Choose a tag to compare

@veyga veyga released this 31 Aug 20:50
ce9f33f

Update project URLs to point to docs site. Fix lockfile to use public PyPI.

v1.0.0

Choose a tag to compare

@veyga veyga released this 31 Aug 20:22
0b4fba8

Initial release of funstruct — fun & functional structures for Python.