freer-simple 1.0.0.0 → 1.0.1.0
raw patch · 5 files changed
+34/−9 lines, 5 filesdep ~extensible-effectsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: extensible-effects
API changes (from Hackage documentation)
+ Control.Monad.Freer: subsume :: forall eff effs. Member eff effs => Eff (eff : effs) ~> Eff effs
+ Control.Monad.Freer.State: gets :: forall s a effs. Member (State s) effs => (s -> a) -> Eff effs a
Files
- CHANGELOG.md +5/−0
- freer-simple.cabal +15/−9
- src/Control/Monad/Freer.hs +7/−0
- src/Control/Monad/Freer/State.hs +6/−0
- src/Data/OpenUnion/Internal.hs +1/−0
CHANGELOG.md view
@@ -1,3 +1,8 @@+# 1.0.1.0++- Added `subsume` to `Control.Monad.Freer` for deduplicating effects.+- Added `gets` to `Control.Monad.Freer.State` ([#1](https://github.com/lexi-lambda/freer-simple/pull/1)).+ # 1.0.0.0 - Initial release.
freer-simple.cabal view
@@ -1,9 +1,11 @@--- This file has been generated from package.yaml by hpack version 0.18.1.+-- This file has been generated from package.yaml by hpack version 0.20.0. -- -- see: https://github.com/sol/hpack+--+-- hash: 1b33b14be04bebcd0fa94c86502cf8b40f41ecf708b33c723951b76d9ef4f017 name: freer-simple-version: 1.0.0.0+version: 1.0.1.0 synopsis: Implementation of a friendly effect system for Haskell. description: An implementation of an effect system for Haskell (a fork of <http://hackage.haskell.org/package/freer-effects freer-effects>), which is@@ -43,8 +45,8 @@ default-extensions: ConstraintKinds DataKinds DeriveFunctor FlexibleContexts FlexibleInstances FunctionalDependencies GADTs LambdaCase MultiParamTypeClasses RankNTypes ScopedTypeVariables TypeApplications TypeOperators ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints build-depends:- base >= 4.9 && < 5- , natural-transformation >= 0.2+ base >=4.9 && <5+ , natural-transformation >=0.2 , transformers-base exposed-modules: Control.Monad.Freer@@ -71,7 +73,7 @@ default-extensions: ConstraintKinds DataKinds DeriveFunctor FlexibleContexts FlexibleInstances FunctionalDependencies GADTs LambdaCase MultiParamTypeClasses RankNTypes ScopedTypeVariables TypeApplications TypeOperators ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints build-depends:- base >= 4.9 && < 5+ base >=4.9 && <5 , freer-simple other-modules: Capitalize@@ -79,6 +81,7 @@ Coroutine Fresh Trace+ Paths_freer_simple default-language: Haskell2010 test-suite unit@@ -89,8 +92,8 @@ default-extensions: ConstraintKinds DataKinds DeriveFunctor FlexibleContexts FlexibleInstances FunctionalDependencies GADTs LambdaCase MultiParamTypeClasses RankNTypes ScopedTypeVariables TypeApplications TypeOperators ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints build-depends:- base >= 4.9 && < 5- , QuickCheck+ QuickCheck+ , base >=4.9 && <5 , freer-simple , tasty , tasty-hunit@@ -103,6 +106,7 @@ Tests.NonDet Tests.Reader Tests.State+ Paths_freer_simple default-language: Haskell2010 benchmark core@@ -113,10 +117,12 @@ default-extensions: ConstraintKinds DataKinds DeriveFunctor FlexibleContexts FlexibleInstances FunctionalDependencies GADTs LambdaCase MultiParamTypeClasses RankNTypes ScopedTypeVariables TypeApplications TypeOperators ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -O2 build-depends:- base >= 4.9 && < 5+ base >=4.9 && <5 , criterion- , extensible-effects+ , extensible-effects <2 , free , freer-simple , mtl+ other-modules:+ Paths_freer_simple default-language: Haskell2010
src/Control/Monad/Freer.hs view
@@ -217,6 +217,7 @@ -- *** Basic effect handlers , interpret , interpose+ , subsume -- *** Derived effect handlers , reinterpret , reinterpret2@@ -264,6 +265,12 @@ interpose :: forall eff effs. Member eff effs => (eff ~> Eff effs) -> Eff effs ~> Eff effs interpose f = interposeWith (\e -> (f e >>=)) {-# INLINE interpose #-}++-- | Interprets an effect in terms of another identical effect. This can be used+-- to eliminate duplicate effects.+subsume :: forall eff effs. Member eff effs => Eff (eff ': effs) ~> Eff effs+subsume = interpret send+{-# INLINE subsume #-} -- | Like 'interpret', but instead of removing the interpreted effect @f@, -- reencodes it in some new effect @g@.
src/Control/Monad/Freer/State.hs view
@@ -27,6 +27,7 @@ , get , put , modify+ , gets -- * State Handlers , runState@@ -60,6 +61,11 @@ -- @(s -> s)@. modify :: forall s effs. Member (State s) effs => (s -> s) -> Eff effs () modify f = fmap f get >>= put++-- | Retrieve a specific component of the current state using the provided+-- projection function.+gets :: forall s a effs. Member (State s) effs => (s -> a) -> Eff effs a+gets f = f <$> get -- | Handler for 'State' effects. runState :: forall s effs a. s -> Eff (State s ': effs) a -> Eff effs (a, s)
src/Data/OpenUnion/Internal.hs view
@@ -1,3 +1,4 @@+{-# OPTIONS_GHC -Wno-redundant-constraints #-} -- Due to use of TypeError. {-# OPTIONS_HADDOCK not-home #-} {-# LANGUAGE AllowAmbiguousTypes #-}