free 4.6 → 4.6.1
raw patch · 3 files changed
+10/−1 lines, 3 files
Files
- CHANGELOG.markdown +4/−0
- free.cabal +1/−1
- src/Control/Monad/Free/Church.hs +5/−0
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+4.6.1+-----+* Added `hoistF`+ 4.6 --- * Víctor López Juan and Fabian Ruch added many documentation improvements and a whole host of proofs of correctness.
free.cabal view
@@ -1,6 +1,6 @@ name: free category: Control, Monads-version: 4.6+version: 4.6.1 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE
src/Control/Monad/Free/Church.hs view
@@ -54,6 +54,7 @@ , iterM , toF , retract+ , hoistF , MonadFree(..) , liftF ) where@@ -142,6 +143,10 @@ retract :: Monad m => F m a -> m a retract (F m) = m return Monad.join {-# INLINE retract #-}++-- | Lift a natural transformation from @f@ to @g@ into a natural transformation from @F f@ to @F g@.+hoistF :: (forall x. f x -> g x) -> F f a -> F g a+hoistF t (F m) = F (\p f -> m p (f . t)) -- | Convert to another free monad representation. fromF :: MonadFree f m => F f a -> m a