List 0.6.0 → 0.6.1
raw patch · 3 files changed
+92/−3 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Control.Monad.ListT: instance GHC.Base.Monad m => Data.Semigroup.Semigroup (Control.Monad.ListT.ListT m a)
Files
- CHANGELOG.md +78/−0
- List.cabal +3/−2
- src/Control/Monad/ListT.hs +11/−1
+ CHANGELOG.md view
@@ -0,0 +1,78 @@+0.6.1+----+* Compatibility with Semigroup/Monoid proposal++0.6.0+----+* `ListT` only available via `Control.Monad.ListT`. Resolves clash with other packages (for inclusion in Stackage).++0.5.2+----+* `Alternative` instance++0.5.1+----+* `splitWhenM` - a monadic variant of `break`++0.5.0+----+* Add `mapMaybe`++0.4.4+----+* Temporarily remove `mapMaybe` which will require bumping major version. Its previous addition in version 0.4.3 broke the `hexpat` package which used open imports causing a name clash when it was added.++0.4.3+----+* Add `take` - a specialized version of `genericTake`+* Add `splitAtM`+* Add `catMaybe`+* Add `mapMaybe` (temporarily removed in 0.4.4)++0.4.2+----+* `cons` moved to List class so one could override with faster implementations+* Add `enumFrom`+* Add `enumFromTo`+* Add `tail`+* Add `filterL`++0.4.1+----+* `Control.Monad.Trans.List.Funcs`: List functions specialized to `ListT` (to tell type inference what type is used)+* Avoid using `RankNTypes`+* `cons` is a right-associative operator+* `ListT` also available on `Control.Monad.Trans.List` (reverted in 0.6.0)+* Add `concat` (different from `join` in that inner lists are pure lists)+* Add `concatMap` (different from `(=<<)` in that inner lists are pure lists)+* Add `scanl1`+* Add `repeatM`++0.4.0+----+* Re-introduce `joinM` due to use-cases in `hexpat`+* Add `mapL`++0.3.0+----+* Add minor version number according to the package versioning policy.+* Use `transformers` instead of `mtl`+* Expose `ListT`'s data constructor+* `joinM` removed. Use `(>>= lift)` instead. (re-introduced in 0.4.0)+* `Functor` instance for `ListItem`+* `listStateJoin` - embeds `StateT` inside the list.+* Add `takeWhile`+* Add `sortOn`+* Add `iterateM`+* Add `foldl1L`++0.2+----+* Add instances for `Eq`, `Ord`, `Read`, `Show`+* `foldrListT'` generalized to `foldrL'+* `List` class independent of `ListT` - `toListT` and `fromListT` class functions removed.+* Add `foldrL`++0.1+----+* Initial version
List.cabal view
@@ -1,5 +1,5 @@ Name: List-Version: 0.6.0+Version: 0.6.1 Category: Control Synopsis: List monad transformer and class Description:@@ -9,10 +9,11 @@ License-file: LICENSE Author: Yair Chuchem Maintainer: yairchu@gmail.com-Homepage: http://github.com/yairchu/generator/tree+Homepage: http://github.com/yairchu/generator Cabal-Version: >= 1.2 Stability: experiemental Build-type: Simple+Extra-source-files: CHANGELOG.md Library hs-Source-Dirs: src
src/Control/Monad/ListT.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, StandaloneDeriving, TypeFamilies, UndecidableInstances #-}+{-# LANGUAGE CPP, FlexibleInstances, MultiParamTypeClasses, StandaloneDeriving, TypeFamilies, UndecidableInstances #-} -- | A list monad transformer / a monadic list. --@@ -29,6 +29,9 @@ import Control.Monad (MonadPlus(..), ap, liftM) import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Trans.Class (MonadTrans(..))+#if MIN_VERSION_base(4,9,0)+import Data.Semigroup (Semigroup(..))+#endif import Data.Monoid (Monoid(..)) newtype ListT m a =@@ -46,9 +49,16 @@ where step x = return . consFunc x . joinL +#if MIN_VERSION_base(4,9,0)+instance Monad m => Semigroup (ListT m a) where+ (<>) = flip (foldrL' cons)+#endif+ instance Monad m => Monoid (ListT m a) where mempty = ListT $ return Nil+#if !(MIN_VERSION_base(4,11,0)) mappend = flip (foldrL' cons)+#endif instance Monad m => Functor (ListT m) where fmap func = foldrL' (cons . func) mempty