packages feed

List 0.6.1 → 0.6.2

raw patch · 3 files changed

+11/−3 lines, 3 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Control.Monad.ListT: instance GHC.Base.Monad m => GHC.Base.Functor (Control.Monad.ListT.ListT m)
+ Control.Monad.ListT: instance GHC.Base.Functor m => GHC.Base.Functor (Control.Monad.ListT.ListT m)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+0.6.2+----+* `ListT`'s `Functor` instance doesn't require an underlying `Monad`.+ 0.6.1 ---- * Compatibility with Semigroup/Monoid proposal
List.cabal view
@@ -1,5 +1,5 @@ Name:                List-Version:             0.6.1+Version:             0.6.2 Category:            Control Synopsis:            List monad transformer and class Description:
src/Control/Monad/ListT.hs view
@@ -60,8 +60,12 @@     mappend = flip (foldrL' cons) #endif -instance Monad m => Functor (ListT m) where-    fmap func = foldrL' (cons . func) mempty+instance Functor m => Functor (ListT m) where+    fmap func (ListT action) =+        ListT (fmap f action)+        where+            f Nil = Nil+            f (Cons x xs) = Cons (func x) (fmap func xs)  instance Monad m => Monad (ListT m) where     return = ListT . return . (`Cons` mempty)