packages feed

indexed-free 0.2 → 0.2.1

raw patch · 3 files changed

+9/−4 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Control.Monad.Indexed.Free.Class: iliftFree :: (IxFunctor f, IxMonadFree f m) => f i j a -> m i j a

Files

Control/Monad/Indexed/Free/Class.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
-module Control.Monad.Indexed.Free.Class (IxMonadFree(..)) where
+module Control.Monad.Indexed.Free.Class (IxMonadFree(..), iliftFree) where
 import Control.Monad.Indexed
 
 class IxMonad m => IxMonadFree f m | m -> f where
Control/Monad/Indexed/Trans/Free.hs view
@@ -47,4 +47,9 @@ transIxFreeT :: (IxFunctor g, Monad m) => (forall i j x. f i j x -> g i j x) -> IxFreeT f m i j a -> IxFreeT g m i j a
 transIxFreeT f (IxFreeT m) = IxFreeT $ m >>= \r -> return $ case r of
     Pure a -> Pure a
-    Free fm -> Free $ imap (transIxFreeT f) (f fm) +    Free fm -> Free $ imap (transIxFreeT f) (f fm)
+
+hoistIxFreeT :: (IxFunctor f, Monad m) => (forall x. m x -> n x) -> IxFreeT f m i j a -> IxFreeT f n i j a
+hoistIxFreeT t (IxFreeT m) = IxFreeT $ t $ m >>= \r -> return $ case r of
+    Pure a -> Pure a
+    Free fm -> Free $ imap (hoistIxFreeT t) fm
indexed-free.cabal view
@@ -1,5 +1,5 @@ name:                indexed-free
-version:             0.2
+version:             0.2.1
 synopsis:            indexed monads for free
 description:         A free indexed monad
 homepage:            https://github.com/fumieval/indexed-free
@@ -8,7 +8,7 @@ author:              Fumiaki Kinoshita
 maintainer:          Fumiaki Kinoshita <fumiexcel@gmail.com>
 copyright:           Copyright (C) 2013 Fumiaki Kinoshita
-category:            Language
+category:            Control, Monad
 build-type:          Simple
 cabal-version:       >=1.8