Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2.3.2 -- 2025-12-07
-----
* Add `Accum` monad.
* Generalize `MonadAccum` instance for all `Monad m` underlying `AccumT`, not just `Identity`.
* Allow building monokinded `ContT` if the compiler is MicroHs.
* Fix an issue where `QuantifiedConstraints` in the definition of `liftCallCC` was was preventing building under certain conditions.
* Add `Control.Monad.Class.onError`.
* Add various instances for `Data.Functor.Product.Product`.

2.3.1 -- 2022-09-10
-----
* Add `modifyError` to `Control.Monad.Error.Class`, and re-export from
Expand Down
1 change: 1 addition & 0 deletions Control/Monad/Error/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ instance
throwError = lift . throwError
catchError = Accum.liftCatch catchError

-- | @since 2.3.2
instance (MonadError e m, MonadError e n) => MonadError e (Product m n) where
throwError e = Pair (throwError e) (throwError e)
catchError (Pair ma na) f = Pair (catchError ma (productFst . f)) (catchError na (productSnd . f))
Expand Down
1 change: 1 addition & 0 deletions Control/Monad/RWS/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ instance MonadRWS r w s m => MonadRWS r w s (ExceptT e m)
instance MonadRWS r w s m => MonadRWS r w s (IdentityT m)
instance MonadRWS r w s m => MonadRWS r w s (MaybeT m)

-- | @since 2.3.2
instance (MonadRWS r w s m, MonadRWS r w s n) => MonadRWS r w s (Product m n)
1 change: 1 addition & 0 deletions Control/Monad/Reader/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ instance
local f (runSelectT m (local (const r) . c))
reader = lift . reader

-- | @since 2.3.2
instance (MonadReader r m, MonadReader r n) => MonadReader r (Product m n) where
ask = Pair ask ask
local f (Pair ma na) = Pair (local f ma) (local f na)
1 change: 1 addition & 0 deletions Control/Monad/State/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ instance MonadState s m => MonadState s (SelectT r m) where
put = lift . put
state = lift . state

-- | @since 2.3.2
instance (MonadState s m, MonadState s n) => MonadState s (Product m n) where
get = Pair get get
put s = Pair (put s) (put s)
Expand Down
1 change: 1 addition & 0 deletions Control/Monad/Writer/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ instance
listen = Accum.liftListen listen
pass = Accum.liftPass pass

-- | @since 2.3.2
instance (MonadWriter w m, MonadWriter w n) => MonadWriter w (Product m n) where
writer aw = Pair (writer aw) (writer aw)
tell w = Pair (tell w) (tell w)
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `mtl` [![Hackage](https://img.shields.io/hackage/v/mtl.svg)](https://hackage.haskell.org/package/mtl) [![Build Status](https://travis-ci.org/haskell/mtl.svg)](https://travis-ci.org/haskell/mtl)
# `mtl` [![Hackage](https://img.shields.io/hackage/v/mtl.svg)](https://hackage.haskell.org/package/mtl)

MTL is a collection of monad classes, extending the `transformers`
package, using functional dependencies for generic lifting of monadic
Expand Down
6 changes: 4 additions & 2 deletions mtl.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: mtl
version: 2.3.1
version: 2.3.2
license: BSD-3-Clause
license-file: LICENSE
author: Andy Gill
Expand All @@ -18,9 +18,11 @@ description:
build-type: Simple

extra-source-files:
CHANGELOG.markdown
README.markdown

extra-doc-files:
CHANGELOG.markdown

tested-with: GHC ==8.10 || ==9.2 || ==9.8 || ==9.10 || ==9.12, MHS ==0.14.15.0

source-repository head
Expand Down