heftia 0.3.0.0 → 0.3.1.0
raw patch · 2 files changed
+33/−13 lines, 2 filesdep ~data-effectsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: data-effects
API changes (from Hackage documentation)
- Data.Hefty.Union: [FoundInSym0KindInference] :: SameKind (Apply FoundInSym0 arg_aoRU) (FoundInSym1 arg_aoRU) => FoundInSym0 a6989586621679105391
+ Data.Hefty.Union: [FoundInSym0KindInference] :: SameKind (Apply FoundInSym0 arg_aoTP) (FoundInSym1 arg_aoTP) => FoundInSym0 a6989586621679105510
- Data.Hefty.Union: [SFoundIn] :: forall (n_aoRZ :: FoundLevel). () => Sing n_aoRZ -> SSearchResult (FoundIn n_aoRZ :: SearchResult)
+ Data.Hefty.Union: [SFoundIn] :: forall (n_aoTU :: FoundLevel). () => Sing n_aoTU -> SSearchResult (FoundIn n_aoTU :: SearchResult)
Files
- README.md +31/−11
- heftia.cabal +2/−2
README.md view
@@ -188,25 +188,45 @@ * Effect System: For a term representing an effectful program, is it possible to statically decidable a type that enumerates all the effects the program may produce? * Purely Monadic: Is an effectful program represented as a transparent data structure that is a monad, and can it be interpreted into other data types using only pure operations without side effects or `unsafePerformIO`? * Dynamic Effect Rewriting: Can an effectful program have its internal effects altered afterwards (by functions typically referred to as `handle with`, `intercept`, `interpose`, `transform`, `translate`, or `rewrite`) ?++ For example, would it be possible to apply `interpose` as many times as the number of values input by the user at runtime?++* Semantics: Classification of behaviors resulting from the interpretation of effects.++ * continuation-based: The same as Algebraic Effects and Handlers.+ * IO-based: IO + Reader pattern.+ * carrier dependent: The behavior depends on the specific type inference result of the monad. Tagless-final style.+ * Performance: Time complexity or space complexity. -| Library or Language | Higher-Order Effects | Delimited Continuation | Effect System | Purely Monadic | Dynamic Effect Rewriting | Performance (TODO) |-| ------------------- | -------------------- | ---------------------- | --------------| --------------------------------- | ------------------------ | ------------------ |-| Heftia | Yes | Multi-shot | Yes | Yes (also Applicative and others) | Yes | ? |-| freer-simple | No | Multi-shot | Yes | Yes | Yes | ? |-| Polysemy | Yes | No | Yes | Yes | Yes | ? |-| Effectful | Yes | No | Yes | No (based on the `IO` monad) | Yes | ? |-| eff | Yes | Multi-shot? | Yes | No (based on the `IO` monad) | Yes | Fast |-| mtl | Yes | Multi-shot (`ContT`) | Yes | Yes | No | ? |-| fused-effects | Yes | No? | Yes | Yes | No | ? |-| koka-lang | No [^2] | Multi-shot | Yes | No (language built-in) | Yes | ? |-| OCaml-lang 5 | ? | One-shot | No [^3] | No (language built-in) | ? | ? |+| Library or Language | Higher-Order Effects | Delimited Continuation | Effect System | Purely Monadic | Dynamic Effect Rewriting | Semantics | Performance (TODO) |+| ------------------- | -------------------- | ---------------------- | --------------| --------------------------------- | ------------------------ | -------------------------------- | ------------------ |+| Heftia | Yes | Multi-shot | Yes | Yes (also Applicative and others) | Yes | continuation-based | ? |+| freer-simple | No | Multi-shot | Yes | Yes | Yes | continuation-based | ? |+| Polysemy | Yes | No | Yes | Yes | Yes | weaving-based (functorial state) | ? |+| Effectful | Yes | No | Yes | No (based on the `IO` monad) | Yes | IO-based | ? |+| eff | Yes | Multi-shot? | Yes | No (based on the `IO` monad) | Yes | continuation-based (IO-fused) | ? |+| in-other-words | Yes | Multi-shot? | Yes | Yes | No? | carrier dependent | ? |+| mtl | Yes | Multi-shot (`ContT`) | Yes | Yes | No | carrier dependent | ? |+| fused-effects | Yes | No? | Yes | Yes | No | carrier dependent & weaving-based (functorial state) | ? |+| koka-lang | No [^2] | Multi-shot | Yes | No (language built-in) | Yes | continuation-based | ? |+| OCaml-lang 5 | ? | One-shot | No [^3] | No (language built-in) | ? | continuation-based? | ? | [^2]: https://gist.github.com/ymdryo/6fb2f7f4020c6fcda98ccc67c090dc75 [^3]: Effects do not appear in the type signature and can potentially cause unhandled errors at runtime Heftia can simply be described as a higher-order version of freer-simple. This is indeed true in terms of its internal mechanisms as well.++Additionally, this library provides a consistent *continuation-based* semantics that is independent of carriers and effects.+On the other hand, in libraries like in-other-words, mtl, and fused-effects, the semantics of the code depend on the effect and, in part, the carrier inferred by type inference.+Fixing the semantics to a *continuation-based* model helps improve the predictability of the behavior (interpretation result) of the code.++Carrier-dependent semantics can lead to unexpected behavior for code readers, particularly in situations where the types become implicit.+Particularly, attention should be given to the fact that due to type inference, semantic changes may propagate beyond the blocks enclosed by `interpret` or `interpose`.+In the case of carrier-independent semantics, especially with Freer-based effects, `interpret` and `interpose` do not alter the semantics by intervening in type inference or instance resolution of the carrier.+Instead, they function as traditional functions, simply transforming the content of the data structure.+This results in minimal surprise to the mental model of the code reader. ### Compatibility with other libraries #### Representation of effects
heftia.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: heftia-version: 0.3.0.0+version: 0.3.1.0 -- A short (one-line) description of the package. synopsis: higher-order effects done right@@ -98,7 +98,7 @@ -- other-extensions: build-depends: base ^>= 4.16.4.0,- data-effects ^>= 0.1.1,+ data-effects ^>= 0.1.2, mtl ^>= 2.2.2, free ^>= 5.2, kan-extensions ^>= 5.2.5,