Skip to content

Commit

Permalink
Fix CPP around Magnify ListT and ErrorT instances
Browse files Browse the repository at this point in the history
Tested by building

```
cabal build --constraint 'mtl >= 2.3' --constraint 'transformers < 0.6' all --disable-tests
cabal build --constraint 'mtl >= 2.3' --constraint 'transformers >= 0.6' all --disable-tests
cabal build --constraint 'mtl < 2.3' all --disable-tests
```
  • Loading branch information
phadej committed May 20, 2022
1 parent b2a02c7 commit 84d5b7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions optics-extra/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# optics-extra-0.4.2.1 (2022-05-20)
* Fix for previous release when used with `mtl-2.3` and `transformers-0.5`.

# optics-extra-0.4.2 (2022-05-19)
* Allow `transformers-0.6` and `mtl-2.3`

Expand Down
2 changes: 1 addition & 1 deletion optics-extra/optics-extra.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: optics-extra
version: 0.4.2
version: 0.4.2.1
license: BSD-3-Clause
license-file: LICENSE
build-type: Simple
Expand Down
4 changes: 2 additions & 2 deletions optics-extra/src/Optics/Zoom.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import qualified Control.Monad.Trans.State.Strict as S
import qualified Control.Monad.Trans.Writer.Lazy as L
import qualified Control.Monad.Trans.Writer.Strict as S

#if !MIN_VERSION_transformers(0,6,0)
#if !MIN_VERSION_transformers(0,6,0) && !MIN_VERSION_mtl(2,3,0)
import Control.Monad.Trans.Error (Error, ErrorT (..))
import Control.Monad.Trans.List (ListT (..))
#endif
Expand Down Expand Up @@ -395,7 +395,7 @@ instance MagnifyMany m n b a => MagnifyMany (ExceptT e m) (ExceptT e n) b a wher
magnifyMany o = ExceptT #. fmap getErr . magnifyMany o . fmap Err .# runExceptT
{-# INLINE magnifyMany #-}

#if !MIN_VERSION_transformers(0,6,0)
#if !MIN_VERSION_transformers(0,6,0) && !MIN_VERSION_mtl(2,3,0)
instance (Error e, Magnify m n b a) => Magnify (ErrorT e m) (ErrorT e n) b a where
magnify o = ErrorT #. magnify o .# runErrorT
magnifyMaybe o =
Expand Down

0 comments on commit 84d5b7a

Please sign in to comment.