packages feed

monadic-recursion-schemes 0.1.5.0 → 0.1.6.0

raw patch · 3 files changed

+21/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for monadic-recursion-schemes +## 0.1.6.0 -- 2020-05-15++* add preproM and postproM.+ ## 0.1.5.0 -- 2020-05-14  * add mutuM and comutuM with the other variant, which has not the same type signature.
monadic-recursion-schemes.cabal view
@@ -4,7 +4,7 @@ -- http://haskell.org/cabal/users-guide/  name:                monadic-recursion-schemes-version:             0.1.5.0+version:             0.1.6.0 synopsis:            Recursion Schemes for Monadic version. description:         Yet another recursion schemes for monadic style, depends on recursion-schemes. homepage:            https://github.com/cutsea110/monadic-recursion-schemes.git
src/Data/Functor/Foldable/Monadic.hs view
@@ -238,4 +238,20 @@          -> b -> m t comutuM' f psi = anaM psi . f +-- | prepromorphism+preproM :: (Monad m, Traversable (Base t), Recursive t, Corecursive t)+        => (Base t t -> m (Base t t)) -- ^ monadic natural transformation+        -> (Base t a -> m a)          -- ^ algebra+        -> t -> m a+preproM h phi = u+  where u = phi <=< mapM f . project+        f = u <=< cataM (return . embed <=< h) +-- | postpromorphism+postproM :: (Monad m, Traversable (Base t), Recursive t, Corecursive t)+         => (Base t t -> m (Base t t)) -- ^ monadic natural transformation+         -> (a -> m (Base t a))        -- ^ coalgebra+         -> a -> m t+postproM h psi = u+  where u = return . embed <=< mapM f <=< psi+        f = anaM (h . project) <=< u