functor-combinators 0.4.1.1 → 0.4.1.2
raw patch · 3 files changed
+24/−2 lines, 3 filesdep ~transformersPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependency ranges changed: transformers
API changes (from Hackage documentation)
+ Control.Monad.Freer.Church: instance Data.Functor.Invariant.Invariant (Control.Monad.Freer.Church.Free f)
+ Control.Monad.Freer.Church: instance Data.Functor.Invariant.Invariant (Control.Monad.Freer.Church.Free1 f)
+ Control.Monad.Freer.Church: instance Data.Functor.Invariant.Invariant g => Data.Functor.Invariant.Invariant (Control.Monad.Freer.Church.Comp f g)
Files
- CHANGELOG.md +9/−0
- functor-combinators.cabal +1/−1
- src/Control/Monad/Freer/Church.hs +14/−1
CHANGELOG.md view
@@ -1,6 +1,15 @@ Changelog ========= +Version 0.4.1.2+---------------++*January 29, 2023*++<https://github.com/mstksg/functor-combinators/releases/tag/v0.4.1.2>++* Add Invariant instances to Freer.Church types+ Version 0.4.1.1 ---------------
functor-combinators.cabal view
@@ -7,7 +7,7 @@ -- hash: c98f05061d45352f630dd964c7671a2a414e5708a12f8f4f8a39d61b986f6f5d name: functor-combinators-version: 0.4.1.1+version: 0.4.1.2 synopsis: Tools for functor combinator-based program design description: Tools for working with /functor combinators/: types that take functors (or other indexed types) and returns a new functor that "enhances" or "mixes"
src/Control/Monad/Freer/Church.hs view
@@ -36,7 +36,6 @@ ) where import Control.Applicative-import Data.Functor.Plus import Control.Monad import Control.Natural import Data.Foldable@@ -44,6 +43,8 @@ import Data.Functor.Bind import Data.Functor.Classes import Data.Functor.Coyoneda+import Data.Functor.Invariant+import Data.Functor.Plus import Data.Pointed import Data.Semigroup.Foldable import Data.Semigroup.Traversable@@ -91,6 +92,10 @@ instance Functor (Free f) where fmap f x = Free $ \p b -> runFree x (p . f) b +-- | @since 0.4.1.2+instance Invariant (Free f) where+ invmap f _ = fmap f+ instance Apply (Free f) where (<.>) = ap @@ -238,6 +243,10 @@ instance Functor (Free1 f) where fmap f x = Free1 $ \p b -> runFree1 x (\y c -> p y (f . c)) b +-- | @since 0.4.1.2+instance Invariant (Free1 f) where+ invmap f _ = fmap f+ instance Apply (Free1 f) where (<.>) = apDefault @@ -428,6 +437,10 @@ instance Functor g => Functor (Comp f g) where fmap f (x :>>= h) = x :>>= (fmap f . h)++-- | @since 0.4.1.2+instance Invariant g => Invariant (Comp f g) where+ invmap f g (x :>>= h) = x :>>= (invmap f g . h) -- | @since 0.3.6.0 instance (Apply f, Apply g) => Apply (Comp f g) where