effectful-st 0.0.0.0 → 0.0.0.1
raw patch · 4 files changed
+13/−3 lines, 4 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Effectful.ST: instance (s1 GHC.Types.~ s2) => Effectful.ST.STE s1 Effectful.Internal.Effect.:> (Effectful.ST.STE s2 : es)
Files
- CHANGELOG.md +4/−0
- README.md +1/−1
- effectful-st.cabal +2/−2
- src/Effectful/ST.hs +6/−0
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for effectful-st +## 0.0.0.1 -- 2022-09-12++* Add `:>` instance for `STE`. (Helps type inference.)+ ## 0.0.0.0 -- 2022-09-06 * First version. Released on an unsuspecting world.
README.md view
@@ -1,6 +1,6 @@ # `effectful-st` -Version 0.0.0.0+Version 0.0.0.1 ## Description
effectful-st.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: effectful-st-version: 0.0.0.0+version: 0.0.0.1 license: CC0-1.0 license-file: CC0-1.0.txt author: Russell Hernandez Ruiz@@ -34,7 +34,7 @@ source-repository this type: git location: https://git.sr.ht/~qrpnxz/effectful-st- tag: 0.0.0.0+ tag: 0.0.0.1 library hs-source-dirs: src
src/Effectful/ST.hs view
@@ -9,6 +9,8 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-} {-| This modules provides the `STE` effect; a way to run the effect purely, with `Prim`, or with `IOE`; and@@ -48,6 +50,7 @@ SideEffects(NoSideEffects), StaticRep ) import Effectful.Prim ( Prim )+import Effectful.Internal.Effect ( type (:>)(..) ) import Control.Monad.Primitive ( PrimBase(..), PrimMonad(PrimState) )@@ -56,6 +59,9 @@ -- ^ An effect for delimited primitive state-transformer actions. type instance DispatchOf (STE s) = Static NoSideEffects data instance StaticRep (STE s) = STERep++instance {-# INCOHERENT #-} s1 ~ s2 => STE s1 :> (STE s2 : es) where+ reifyIndex = 0 -- | Run an 'Eff' computation with primitive state-transformer actions purely. runSTE :: (forall s. Eff (STE s : es) a) -> Eff es a