commandert 0.1.0.1 → 0.1.1.0
raw patch · 2 files changed
+5/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- commandert.cabal +1/−1
- src/Control/Monad/Commander.hs +4/−0
commandert.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.4 name: commandert-version: 0.1.0.1+version: 0.1.1.0 synopsis: A monad for commanders description: A monad for commanders. homepage: https://github.com/SamuelSchlesinger/commander
src/Control/Monad/Commander.hs view
@@ -60,6 +60,8 @@ -- probably want to use this function. hoistToFunctor :: Functor g => (forall a. f a -> g a) -> CommanderT state f a -> CommanderT state g a hoistToFunctor phi (Action action) = Action (fmap (fmap (first (hoistToFunctor phi))) $ fmap phi action)+hoistToFunctor _phi Defeat = Defeat+hoistToFunctor _phi (Victory a) = Victory a -- | We can go from a 'Functor' to a non-'Functor' inside of a 'CommanderT' -- action. This does the transformation "bottom to top", as opposed to@@ -68,6 +70,8 @@ -- probably want to use this function. hoistFromFunctor :: Functor f => (forall a. f a -> g a) -> CommanderT state f a -> CommanderT state g a hoistFromFunctor phi (Action action) = Action (fmap phi $ fmap (fmap (first (hoistFromFunctor phi))) action)+hoistFromFunctor _phi Defeat = Defeat+hoistFromFunctor _phi (Victory a) = Victory a instance Functor f => Applicative (CommanderT state f) where (<*>) = ap