git.iko.soy/typeable/transformers-lift
on 89e514b help sign in
.gitignore−1
since splitsnapshots
unifiedsplit
@@ -1,4 +1,3 @@
1dist
1dist
2−.stack-work
3.cabal-sandbox/
2.cabal-sandbox/
4cabal.sandbox.config
3cabal.sandbox.config
.travis.yml+9−24
@@ -1,35 +1,20 @@
1−sudo: false
2−
3env:
1env:
2+ - CABALVER=1.18 GHCVER=7.8.4
4− - CABALVER=3.0 GHCVER=7.10.3
3+ - CABALVER=1.22 GHCVER=7.10.2
5− - CABALVER=3.0 GHCVER=8.0.2
6− - CABALVER=3.0 GHCVER=8.2.2
7− - CABALVER=3.0 GHCVER=8.4.4
8− - CABALVER=3.0 GHCVER=8.6.1
9 - CABALVER=head GHCVER=head
4 - CABALVER=head GHCVER=head
10
5
11before_install:
6before_install:
7+ - travis_retry sudo add-apt-repository -y ppa:hvr/ghc
8+ - travis_retry sudo apt-get update
9+ - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
12 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
10 - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
13− - ghc --version
14− - cabal --version
15 - travis_retry cabal update
11 - travis_retry cabal update
16
12
17install:
13install:
18− - cabal install --dep
14+ - cabal --version
15+ - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
16+ - cabal install --only-dependencies
19
17
20script:
18script:
19+ - cabal configure --enable-tests -v2
21 - cabal build
20 - cabal build
22−
23−addons:
24− apt:
25− sources:
26− - hvr-ghc
27− packages:
28− - ghc-7.10.3
29− - ghc-8.0.2
30− - ghc-8.2.2
31− - ghc-8.4.4
32− - ghc-8.6.1
33− - ghc-head
34− - cabal-install-3.0
35− - cabal-install-head
LICENSE+2−2
@@ -1,4 +1,4 @@
1−Copyright (c) 2015, Vladislav Zavialov
1+Copyright (c) 2015, Index Int
2
2
3All rights reserved.
3All rights reserved.
4
4
@@ -13,7 +13,7 @@ modification, are permitted provided that the following conditions are met:
13 disclaimer in the documentation and/or other materials provided
13 disclaimer in the documentation and/or other materials provided
14 with the distribution.
14 with the distribution.
15
15
16− * Neither the name of Vladislav Zavialov nor the names of other
16+ * Neither the name of Index Int nor the names of other
17 contributors may be used to endorse or promote products derived
17 contributors may be used to endorse or promote products derived
18 from this software without specific prior written permission.
18 from this software without specific prior written permission.
19
19
README.mddeleted−5
@@ -1,5 +0,0 @@
1−[![Build Status](https://img.shields.io/travis/int-index/transformers-lift.svg)](https://travis-ci.org/int-index/transformers-lift)
2−[![Hackage](https://img.shields.io/hackage/v/transformers-lift.svg)](https://hackage.haskell.org/package/transformers-lift)
3−
4−`transformers-lift` is a simple and lightweight library that provides type
5−classes for lifting operations through monad transformers.
src/Control/Monad/Trans/Lift/CallCC.hs+17−91
@@ -1,11 +1,9 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2−{-# LANGUAGE RankNTypes #-}
2+{-# LANGUAGE TypeFamilies #-}
3−-- | Lifting the @callCC@ operation.
3+{-# LANGUAGE UndecidableInstances #-}
4module Control.Monad.Trans.Lift.CallCC
4module Control.Monad.Trans.Lift.CallCC
5 ( LiftCallCC(..)
5 ( LiftCallCC(..)
6 , CallCC
6 , CallCC
7− , defaultLiftCallCC
8− , defaultLiftCallCC'
9 , module Control.Monad.Trans.Class
7 , module Control.Monad.Trans.Class
10 ) where
8 ) where
11
9
@@ -15,6 +13,7 @@ import Data.Monoid
15
13
16import Control.Monad.Signatures
14import Control.Monad.Signatures
17import Control.Monad.Trans.Class
15import Control.Monad.Trans.Class
16+import Control.Monad.Trans.Control
18
17
19import qualified Control.Monad.Trans.Except as E
18import qualified Control.Monad.Trans.Except as E
20import qualified Control.Monad.Trans.Identity as I
19import qualified Control.Monad.Trans.Identity as I
@@ -23,124 +22,51 @@ import qualified Control.Monad.Trans.Maybe as M
23import qualified Control.Monad.Trans.Reader as R
22import qualified Control.Monad.Trans.Reader as R
24import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
23import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
25import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
24import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
26−import qualified Control.Monad.Trans.RWS.CPS as RWS.CPS
27import qualified Control.Monad.Trans.State.Lazy as S.Lazy
25import qualified Control.Monad.Trans.State.Lazy as S.Lazy
28import qualified Control.Monad.Trans.State.Strict as S.Strict
26import qualified Control.Monad.Trans.State.Strict as S.Strict
29import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
27import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
30import qualified Control.Monad.Trans.Writer.Strict as W.Strict
28import qualified Control.Monad.Trans.Writer.Strict as W.Strict
31−import qualified Control.Monad.Trans.Writer.CPS as W.CPS
32
29
33−#if MIN_VERSION_transformers(0,5,3)
34−import qualified Control.Monad.Trans.Accum as Acc
35−#endif
36−
37−import Control.Monad.Trans.Lift.StT
38−
39−-- | The class of monad transformers capable of lifting 'callCC'.
40class MonadTrans t => LiftCallCC t where
30class MonadTrans t => LiftCallCC t where
41− -- | Lift the @callCC@ operation.
31+ type CallCCStT t a
42− -- Should satisfy the uniformity property
32+ type CallCCStT t a = StT t a
43− --
44− -- * @'lift' (f k) = f' ('lift' . k) => 'lift' (cf f) = 'liftCallCC' cf f'@
45− --
46− liftCallCC :: Monad m => CallCC m (StT t a) (StT t b) -> CallCC (t m) a b
33+ liftCallCC :: Monad m => CallCC m (CallCCStT t a) (CallCCStT t b) -> CallCC (t m) a b
47−
48− -- | Lift the @callCC@ operation.
49− -- This is an alternative version of 'liftCallCC' included for historical
50− -- reasons. It has a different lifting behavior for the @StateT@ and @RWST@
51− -- monad transformers. Matches what @mtl@ does but doesn't satisfy the
52− -- uniformity property.
53− liftCallCC' :: Monad m => CallCC m (StT t a) (StT t b) -> CallCC (t m) a b
34+ liftCallCC' :: Monad m => CallCC m (CallCCStT t a) (CallCCStT t b) -> CallCC (t m) a b
54 liftCallCC' = liftCallCC
35 liftCallCC' = liftCallCC
55
36
56−-- | Default definition for the 'liftCallCC' method.
57−defaultLiftCallCC
58− :: (Monad m, LiftCallCC n)
59− => (forall x . n m x -> t m x)
60− -- ^ Monad constructor
61− -> (forall o x . t o x -> n o x)
62− -- ^ Monad deconstructor
63− -> CallCC m (StT n a) (StT n b)
64− -> CallCC (t m) a b
65−defaultLiftCallCC t unT callCC f
66− = t $ liftCallCC callCC (\g -> (unT . f) (t . g))
67−
68−-- | Default definition for the 'liftCallCC'' method.
69−defaultLiftCallCC'
70− :: (Monad m, LiftCallCC n)
71− => (forall x . n m x -> t m x)
72− -- ^ Monad constructor
73− -> (forall o x . t o x -> n o x)
74− -- ^ Monad deconstructor
75− -> CallCC m (StT n a) (StT n b)
76− -> CallCC (t m) a b
77−defaultLiftCallCC' t unT callCC f
78− = t $ liftCallCC' callCC (\g -> (unT . f) (t . g))
79−
80instance LiftCallCC (E.ExceptT e) where
37instance LiftCallCC (E.ExceptT e) where
81− liftCallCC = E.liftCallCC
38+ liftCallCC = E.liftCallCC
82− {-# INLINE liftCallCC #-}
83
39
84instance LiftCallCC I.IdentityT where
40instance LiftCallCC I.IdentityT where
85− liftCallCC = I.liftCallCC
41+ liftCallCC = I.liftCallCC
86− {-# INLINE liftCallCC #-}
87
42
88instance LiftCallCC L.ListT where
43instance LiftCallCC L.ListT where
89− liftCallCC = L.liftCallCC
44+ liftCallCC = L.liftCallCC
90− {-# INLINE liftCallCC #-}
91
45
92instance LiftCallCC M.MaybeT where
46instance LiftCallCC M.MaybeT where
93− liftCallCC = M.liftCallCC
47+ liftCallCC = M.liftCallCC
94− {-# INLINE liftCallCC #-}
95
48
96instance LiftCallCC (R.ReaderT r) where
49instance LiftCallCC (R.ReaderT r) where
97− liftCallCC = R.liftCallCC
50+ liftCallCC = R.liftCallCC
98− {-# INLINE liftCallCC #-}
99−
100−instance Monoid w => LiftCallCC (W.Lazy.WriterT w) where
101− liftCallCC = W.Lazy.liftCallCC
102− {-# INLINE liftCallCC #-}
103−
104−instance Monoid w => LiftCallCC (W.Strict.WriterT w) where
105− liftCallCC = W.Strict.liftCallCC
106− {-# INLINE liftCallCC #-}
107−
108−instance Monoid w => LiftCallCC (W.CPS.WriterT w) where
109− liftCallCC = W.CPS.liftCallCC
110− {-# INLINE liftCallCC #-}
111
51
112instance Monoid w => LiftCallCC (RWS.Lazy.RWST r w s) where
52instance Monoid w => LiftCallCC (RWS.Lazy.RWST r w s) where
113 liftCallCC = RWS.Lazy.liftCallCC
53 liftCallCC = RWS.Lazy.liftCallCC
114− {-# INLINE liftCallCC #-}
115 liftCallCC' = RWS.Lazy.liftCallCC'
54 liftCallCC' = RWS.Lazy.liftCallCC'
116− {-# INLINE liftCallCC' #-}
117
55
118instance Monoid w => LiftCallCC (RWS.Strict.RWST r w s) where
56instance Monoid w => LiftCallCC (RWS.Strict.RWST r w s) where
119 liftCallCC = RWS.Strict.liftCallCC
57 liftCallCC = RWS.Strict.liftCallCC
120− {-# INLINE liftCallCC #-}
121 liftCallCC' = RWS.Strict.liftCallCC'
58 liftCallCC' = RWS.Strict.liftCallCC'
122− {-# INLINE liftCallCC' #-}
123−
124−instance Monoid w => LiftCallCC (RWS.CPS.RWST r w s) where
125− liftCallCC = RWS.CPS.liftCallCC
126− {-# INLINE liftCallCC #-}
127− liftCallCC' = RWS.CPS.liftCallCC'
128− {-# INLINE liftCallCC' #-}
129
59
130instance LiftCallCC (S.Lazy.StateT s) where
60instance LiftCallCC (S.Lazy.StateT s) where
131 liftCallCC = S.Lazy.liftCallCC
61 liftCallCC = S.Lazy.liftCallCC
132− {-# INLINE liftCallCC #-}
133 liftCallCC' = S.Lazy.liftCallCC'
62 liftCallCC' = S.Lazy.liftCallCC'
134− {-# INLINE liftCallCC' #-}
135
63
136instance LiftCallCC (S.Strict.StateT s) where
64instance LiftCallCC (S.Strict.StateT s) where
137 liftCallCC = S.Strict.liftCallCC
65 liftCallCC = S.Strict.liftCallCC
138− {-# INLINE liftCallCC #-}
139 liftCallCC' = S.Strict.liftCallCC'
66 liftCallCC' = S.Strict.liftCallCC'
140− {-# INLINE liftCallCC' #-}
141
67
142−#if MIN_VERSION_transformers(0,5,3)
143−instance Monoid w => LiftCallCC (Acc.AccumT w) where
68+instance Monoid w => LiftCallCC (W.Lazy.WriterT w) where
144− liftCallCC = Acc.liftCallCC
69+ liftCallCC = W.Lazy.liftCallCC
70+
71+instance Monoid w => LiftCallCC (W.Strict.WriterT w) where
145− {-# INLINE liftCallCC #-}
72+ liftCallCC = W.Strict.liftCallCC
146−#endif
src/Control/Monad/Trans/Lift/Catch.hs+36−98
@@ -1,10 +1,10 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2−{-# LANGUAGE RankNTypes #-}
2+{-# LANGUAGE TypeFamilies #-}
3−-- | Lifting the @catch@ operation.
3+{-# LANGUAGE UndecidableInstances #-}
4+{-# LANGUAGE DefaultSignatures #-}
4module Control.Monad.Trans.Lift.Catch
5module Control.Monad.Trans.Lift.Catch
5 ( LiftCatch(..)
6 ( LiftCatch(..)
6 , Catch
7 , Catch
7− , defaultLiftCatch
8 , module Control.Monad.Trans.Class
8 , module Control.Monad.Trans.Class
9 ) where
9 ) where
10
10
@@ -14,100 +14,38 @@ import Data.Monoid
14
14
15import Control.Monad.Signatures
15import Control.Monad.Signatures
16import Control.Monad.Trans.Class
16import Control.Monad.Trans.Class
17+import Control.Monad.Trans.Control
18+
19+import Control.Monad.Trans.Except
20+import Control.Monad.Trans.Identity
21+import Control.Monad.Trans.List
22+import Control.Monad.Trans.Maybe
23+import Control.Monad.Trans.Reader
24+import qualified Control.Monad.Trans.RWS.Lazy as Lazy
25+import qualified Control.Monad.Trans.RWS.Strict as Strict
26+import qualified Control.Monad.Trans.State.Lazy as Lazy
27+import qualified Control.Monad.Trans.State.Strict as Strict
28+import qualified Control.Monad.Trans.Writer.Lazy as Lazy
29+import qualified Control.Monad.Trans.Writer.Strict as Strict
17
30
18−import qualified Control.Monad.Trans.Except as E
19−import qualified Control.Monad.Trans.Identity as I
20−import qualified Control.Monad.Trans.List as L
21−import qualified Control.Monad.Trans.Maybe as M
22−import qualified Control.Monad.Trans.Reader as R
23−import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
24−import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
25−import qualified Control.Monad.Trans.RWS.CPS as RWS.CPS
26−import qualified Control.Monad.Trans.State.Lazy as S.Lazy
27−import qualified Control.Monad.Trans.State.Strict as S.Strict
28−import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
29−import qualified Control.Monad.Trans.Writer.Strict as W.Strict
30−import qualified Control.Monad.Trans.Writer.CPS as W.CPS
31−
32−#if MIN_VERSION_transformers(0,5,3)
33−import qualified Control.Monad.Trans.Accum as Acc
34−#endif
35−
36−import Control.Monad.Trans.Lift.StT
37−
38−-- | The class of monad transformers capable of lifting 'catch'.
39class MonadTrans t => LiftCatch t where
31class MonadTrans t => LiftCatch t where
40− -- | Lift the @catch@ operation.
32+ type CatchStT t a
41− -- Should satisfy the uniformity property
33+ type CatchStT t a = StT t a
42− --
43− -- * @'lift' (cf m f) = 'liftCatch' ('lift' . cf) ('lift' f)@
44− --
45− liftCatch :: Monad m => Catch e m (StT t a) -> Catch e (t m) a
34+ liftCatch :: Monad m => Catch e m (CatchStT t a) -> Catch e (t m) a
46−
35+ default liftCatch
47−-- | Default definition for the 'liftCatch' method.
36+ :: (MonadTransControl t, CatchStT t a ~ StT t a, Monad m, Monad (t m))
48−defaultLiftCatch
49− :: (Monad m, LiftCatch n)
50− => (forall x . n m x -> t m x)
51− -- ^ Monad constructor
52− -> (forall o x . t o x -> n o x)
53− -- ^ Monad deconstructor
54− -> Catch e m (StT n a) -> Catch e (t m) a
37+ => Catch e m (CatchStT t a) -> Catch e (t m) a
55−defaultLiftCatch t unT f m h = t $ liftCatch f (unT m) (unT . h)
38+ liftCatch catch m h = do
56−
39+ liftWith (\run -> catch (run m) (run . h)) >>= restoreT . return
40+
57−instance LiftCatch (E.ExceptT e) where
41+instance LiftCatch (ExceptT e)
58− liftCatch f m h = E.ExceptT $ f (E.runExceptT m) (E.runExceptT . h)
59− {-# INLINE liftCatch #-}
60−
61−instance LiftCatch I.IdentityT where
42+instance LiftCatch IdentityT
62− liftCatch = I.liftCatch
63− {-# INLINE liftCatch #-}
64−
65−instance LiftCatch L.ListT where
43+instance LiftCatch ListT
66− liftCatch = L.liftCatch
67− {-# INLINE liftCatch #-}
68−
69−instance LiftCatch M.MaybeT where
44+instance LiftCatch MaybeT
70− liftCatch = M.liftCatch
71− {-# INLINE liftCatch #-}
72−
73−instance LiftCatch (R.ReaderT r) where
45+instance LiftCatch (ReaderT r)
74− liftCatch = R.liftCatch
75− {-# INLINE liftCatch #-}
76−
77−instance Monoid w => LiftCatch (RWS.Lazy.RWST r w s) where
46+instance Monoid w => LiftCatch (Lazy.RWST r w s)
78− liftCatch = RWS.Lazy.liftCatch
79− {-# INLINE liftCatch #-}
80−
81−instance Monoid w => LiftCatch (RWS.Strict.RWST r w s) where
47+instance Monoid w => LiftCatch (Strict.RWST r w s)
82− liftCatch = RWS.Strict.liftCatch
83− {-# INLINE liftCatch #-}
84−
85−instance Monoid w => LiftCatch (RWS.CPS.RWST r w s) where
48+instance LiftCatch (Lazy.StateT s)
86− liftCatch = RWS.CPS.liftCatch
87− {-# INLINE liftCatch #-}
88−
89−instance LiftCatch (S.Lazy.StateT s) where
90− liftCatch = S.Lazy.liftCatch
91− {-# INLINE liftCatch #-}
92−
93−instance LiftCatch (S.Strict.StateT s) where
49+instance LiftCatch (Strict.StateT s)
94− liftCatch = S.Strict.liftCatch
95− {-# INLINE liftCatch #-}
96−
97−instance Monoid w => LiftCatch (W.Lazy.WriterT w) where
50+instance Monoid w => LiftCatch (Lazy.WriterT w)
98− liftCatch = W.Lazy.liftCatch
99− {-# INLINE liftCatch #-}
100−
101−instance Monoid w => LiftCatch (W.Strict.WriterT w) where
51+instance Monoid w => LiftCatch (Strict.WriterT w)
102− liftCatch = W.Strict.liftCatch
103− {-# INLINE liftCatch #-}
104−
105−instance Monoid w => LiftCatch (W.CPS.WriterT w) where
106− liftCatch = W.CPS.liftCatch
107− {-# INLINE liftCatch #-}
108−
109−#if MIN_VERSION_transformers(0,5,3)
110−instance Monoid w => LiftCatch (Acc.AccumT w) where
111− liftCatch = Acc.liftCatch
112− {-# INLINE liftCatch #-}
113−#endif
src/Control/Monad/Trans/Lift/Listen.hs+20−73
@@ -1,10 +1,9 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2−{-# LANGUAGE RankNTypes #-}
2+{-# LANGUAGE TypeFamilies #-}
3−-- | Lifting the @listen@ operation.
3+{-# LANGUAGE UndecidableInstances #-}
4module Control.Monad.Trans.Lift.Listen
4module Control.Monad.Trans.Lift.Listen
5 ( LiftListen(..)
5 ( LiftListen(..)
6 , Listen
6 , Listen
7− , defaultLiftListen
8 , module Control.Monad.Trans.Class
7 , module Control.Monad.Trans.Class
9 ) where
8 ) where
10
9
@@ -14,107 +13,55 @@ import Data.Monoid
14
13
15import Control.Monad.Signatures
14import Control.Monad.Signatures
16import Control.Monad.Trans.Class
15import Control.Monad.Trans.Class
16+import Control.Monad.Trans.Control
17+
18+import qualified Control.Monad.Trans.Except as E
19+import qualified Control.Monad.Trans.Identity as I
20+import qualified Control.Monad.Trans.Maybe as M
21+import qualified Control.Monad.Trans.Reader as R
22+import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
23+import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
24+import qualified Control.Monad.Trans.State.Lazy as S.Lazy
25+import qualified Control.Monad.Trans.State.Strict as S.Strict
26+import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
27+import qualified Control.Monad.Trans.Writer.Strict as W.Strict
17
28
18−import qualified Control.Monad.Trans.Except as E
19−import qualified Control.Monad.Trans.Identity as I
20−import qualified Control.Monad.Trans.Maybe as M
21−import qualified Control.Monad.Trans.Reader as R
22−import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
23−import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
24−import qualified Control.Monad.Trans.RWS.CPS.Internal as RWS.CPS
25−import qualified Control.Monad.Trans.State.Lazy as S.Lazy
26−import qualified Control.Monad.Trans.State.Strict as S.Strict
27−import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
28−import qualified Control.Monad.Trans.Writer.Strict as W.Strict
29−import qualified Control.Monad.Trans.Writer.CPS.Internal as W.CPS
30−
31−#if MIN_VERSION_transformers(0,5,3)
32−import qualified Control.Monad.Trans.Accum as Acc
33−#endif
34−
35−import Control.Monad.Trans.Lift.StT
36−
37−-- | The class of monad transformers capable of lifting 'listen'.
38class MonadTrans t => LiftListen t where
29class MonadTrans t => LiftListen t where
39− -- | Lift the @listen@ operation.
30+ type ListenStT t a
40− -- Should satisfy the uniformity property
31+ type ListenStT t a = StT t a
41− --
42− -- * @'lift' . 'liftListen' = 'liftListen' . 'lift'@
43− --
44− liftListen :: Monad m => Listen w m (StT t a) -> Listen w (t m) a
32+ liftListen :: Monad m => Listen w m (ListenStT t a) -> Listen w (t m) a
45−
33+ -- TODO: investigate how MonadTransControl can be used for default definition
46−-- | Default definition for the `liftListen` method.
47−defaultLiftListen
48− :: (Monad m, LiftListen n)
49− => (forall x . n m x -> t m x)
50− -- ^ Monad constructor
51− -> (forall o x . t o x -> n o x)
52− -- ^ Monad deconstructor
53− -> Listen w m (StT n a) -> Listen w (t m) a
54−defaultLiftListen t unT listen m = t $ liftListen listen (unT m)
55
34
56instance LiftListen (E.ExceptT e) where
35instance LiftListen (E.ExceptT e) where
57 liftListen = E.liftListen
36 liftListen = E.liftListen
58− {-# INLINE liftListen #-}
59
37
60instance LiftListen I.IdentityT where
38instance LiftListen I.IdentityT where
61 liftListen = I.mapIdentityT
39 liftListen = I.mapIdentityT
62− {-# INLINE liftListen #-}
63
40
64instance LiftListen M.MaybeT where
41instance LiftListen M.MaybeT where
65 liftListen = M.liftListen
42 liftListen = M.liftListen
66− {-# INLINE liftListen #-}
67
43
68instance LiftListen (R.ReaderT r) where
44instance LiftListen (R.ReaderT r) where
69 liftListen = R.mapReaderT
45 liftListen = R.mapReaderT
70− {-# INLINE liftListen #-}
71
46
72instance LiftListen (S.Lazy.StateT s) where
47instance LiftListen (S.Lazy.StateT s) where
73 liftListen = S.Lazy.liftListen
48 liftListen = S.Lazy.liftListen
74− {-# INLINE liftListen #-}
75
49
76instance LiftListen (S.Strict.StateT s) where
50instance LiftListen (S.Strict.StateT s) where
77 liftListen = S.Strict.liftListen
51 liftListen = S.Strict.liftListen
78− {-# INLINE liftListen #-}
79
52
80instance Monoid w' => LiftListen (RWS.Lazy.RWST r w' s) where
53instance Monoid w' => LiftListen (RWS.Lazy.RWST r w' s) where
81− liftListen listen m = RWS.Lazy.RWST $ \r s -> do
54+ liftListen = error "TODO"
82− ~((a, w', s'), w) <- listen (RWS.Lazy.runRWST m r s)
83− return ((a, w), w', s')
84− {-# INLINE liftListen #-}
85
55
86instance Monoid w' => LiftListen (RWS.Strict.RWST r w' s) where
56instance Monoid w' => LiftListen (RWS.Strict.RWST r w' s) where
87− liftListen listen m = RWS.Strict.RWST $ \r s -> do
57+ liftListen = error "TODO"
88− ((a, w', s'), w) <- listen (RWS.Strict.runRWST m r s)
89− return ((a, w), w', s')
90− {-# INLINE liftListen #-}
91−
92−instance Monoid w' => LiftListen (RWS.CPS.RWST r w' s) where
93− liftListen listen m = RWS.CPS.RWST $ \r w_ s -> do
94− ((a, w', s'), w) <- listen (RWS.CPS.unRWST m r w_ s)
95− return ((a, w), w', s')
96− {-# INLINE liftListen #-}
97
58
98instance Monoid w' => LiftListen (W.Lazy.WriterT w') where
59instance Monoid w' => LiftListen (W.Lazy.WriterT w') where
99 liftListen listen m = W.Lazy.WriterT $ do
60 liftListen listen m = W.Lazy.WriterT $ do
100 ~((a, w'), w) <- listen (W.Lazy.runWriterT m)
61 ~((a, w'), w) <- listen (W.Lazy.runWriterT m)
101 return ((a, w), w')
62 return ((a, w), w')
102− {-# INLINE liftListen #-}
103
63
104instance Monoid w' => LiftListen (W.Strict.WriterT w') where
64instance Monoid w' => LiftListen (W.Strict.WriterT w') where
105 liftListen listen m = W.Strict.WriterT $ do
65 liftListen listen m = W.Strict.WriterT $ do
106 ((a, w'), w) <- listen (W.Strict.runWriterT m)
66 ((a, w'), w) <- listen (W.Strict.runWriterT m)
107 return ((a, w), w')
67 return ((a, w), w')
108− {-# INLINE liftListen #-}
109−
110−instance Monoid w' => LiftListen (W.CPS.WriterT w') where
111− liftListen listen m = W.CPS.WriterT $ \w_ -> do
112− ((a, w'), w) <- listen (W.CPS.unWriterT m w_)
113− return ((a, w), w')
114− {-# INLINE liftListen #-}
115−
116−#if MIN_VERSION_transformers(0,5,3)
117−instance Monoid w' => LiftListen (Acc.AccumT w') where
118− liftListen = Acc.liftListen
119− {-# INLINE liftListen #-}
120−#endif
src/Control/Monad/Trans/Lift/Local.hs+41−101
@@ -1,10 +1,9 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2{-# LANGUAGE RankNTypes #-}
2{-# LANGUAGE RankNTypes #-}
3−-- | Lifting the 'local' operation.
3+{-# LANGUAGE DefaultSignatures #-}
4module Control.Monad.Trans.Lift.Local
4module Control.Monad.Trans.Lift.Local
5 ( LiftLocal(..)
5 ( LiftLocal(..)
6 , Local
6 , Local
7− , defaultLiftLocal
8 , module Control.Monad.Trans.Class
7 , module Control.Monad.Trans.Class
9 ) where
8 ) where
10
9
@@ -13,106 +12,47 @@ import Data.Monoid
13#endif
12#endif
14
13
15import Control.Monad.Trans.Class
14import Control.Monad.Trans.Class
15+import Control.Monad.Morph
16+
17+import Control.Monad.Trans.Except
18+import Control.Monad.Trans.Identity
19+import Control.Monad.Trans.List
20+import Control.Monad.Trans.Maybe
21+import Control.Monad.Trans.Reader
22+import qualified Control.Monad.Trans.Cont as Cont
23+import qualified Control.Monad.Trans.RWS.Lazy as Lazy
24+import qualified Control.Monad.Trans.RWS.Strict as Strict
25+import qualified Control.Monad.Trans.State.Lazy as Lazy
26+import qualified Control.Monad.Trans.State.Strict as Strict
27+import qualified Control.Monad.Trans.Writer.Lazy as Lazy
28+import qualified Control.Monad.Trans.Writer.Strict as Strict
16
29
17−import qualified Control.Monad.Trans.Cont as C
18−import qualified Control.Monad.Trans.Except as E
19−import qualified Control.Monad.Trans.Identity as I
20−import qualified Control.Monad.Trans.List as L
21−import qualified Control.Monad.Trans.Maybe as M
22−import qualified Control.Monad.Trans.Reader as R
23−import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
24−import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
25−import qualified Control.Monad.Trans.RWS.CPS as RWS.CPS
26−import qualified Control.Monad.Trans.State.Lazy as S.Lazy
27−import qualified Control.Monad.Trans.State.Strict as S.Strict
28−import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
29−import qualified Control.Monad.Trans.Writer.Strict as W.Strict
30−import qualified Control.Monad.Trans.Writer.CPS as W.CPS
31−
32−#if MIN_VERSION_transformers(0,5,3)
33−import qualified Control.Monad.Trans.Accum as Acc
34−#endif
35−
36−-- | Signature of the @local@ operation,
37−-- introduced in "Control.Monad.Trans.Reader".
38type Local r m a = (r -> r) -> m a -> m a
30type Local r m a = (r -> r) -> m a -> m a
39
31
40−-- | The class of monad transformers capable of lifting 'local'.
41class MonadTrans t => LiftLocal t where
32class MonadTrans t => LiftLocal t where
42− -- | Lift the 'local' operation.
33+ liftLocal
34+ :: Monad m
35+ => m r
43− liftLocal :: Monad m => m r -> (forall a . Local r m a)
36+ -> (forall a . Local r m a)
44− -> (forall a . Local r (t m) a)
37+ -> (forall a . Local r (t m) a)
45−
38+ default liftLocal
46−-- | Default definition for the 'liftLocal' method.
39+ :: (Monad m, MFunctor t)
47−defaultLiftLocal
48− :: (Monad m, LiftLocal n)
49− => (forall x . n m x -> t m x)
50− -- ^ Monad constructor
51− -> (forall o x . t o x -> n o x)
52− -- ^ Monad deconstructor
53− -> m r
40+ => m r
54− -> (forall a . Local r m a)
41+ -> (forall a . Local r m a)
55− -> (forall a . Local r (t m) a)
42+ -> (forall a . Local r (t m) a)
56−defaultLiftLocal t unT a l f = t . liftLocal a l f . unT
43+ liftLocal _ l f = hoist (l f)
57−
44+
58−instance LiftLocal (C.ContT r) where
45+instance LiftLocal (Cont.ContT r)
59− liftLocal a l f = C.liftLocal a l f
46+ where liftLocal a l f = Cont.liftLocal a l f
60− {-# INLINE liftLocal #-}
47+
61−
62−instance LiftLocal (E.ExceptT e) where
48+instance LiftLocal (ExceptT e)
63− liftLocal _ l f = E.mapExceptT (l f)
64− {-# INLINE liftLocal #-}
65−
66−instance LiftLocal I.IdentityT where
49+instance LiftLocal IdentityT
67− liftLocal _ l f = I.mapIdentityT (l f)
68− {-# INLINE liftLocal #-}
69−
70−instance LiftLocal L.ListT where
50+instance LiftLocal ListT
71− liftLocal _ l f = L.mapListT (l f)
72− {-# INLINE liftLocal #-}
73−
74−instance LiftLocal M.MaybeT where
51+instance LiftLocal MaybeT
75− liftLocal _ l f = M.mapMaybeT (l f)
76− {-# INLINE liftLocal #-}
77−
78−instance LiftLocal (R.ReaderT r) where
52+instance LiftLocal (ReaderT r)
79− liftLocal _ l f = R.mapReaderT (l f)
80− {-# INLINE liftLocal #-}
81−
82−instance Monoid w => LiftLocal (RWS.Lazy.RWST r w s) where
53+instance Monoid w => LiftLocal (Lazy.RWST r w s)
83− liftLocal _ l f = RWS.Lazy.mapRWST (l f)
84− {-# INLINE liftLocal #-}
85−
86−instance Monoid w => LiftLocal (RWS.Strict.RWST r w s) where
54+instance Monoid w => LiftLocal (Strict.RWST r w s)
87− liftLocal _ l f = RWS.Strict.mapRWST (l f)
88− {-# INLINE liftLocal #-}
89−
90−instance Monoid w => LiftLocal (RWS.CPS.RWST r w s) where
91− liftLocal _ l f = RWS.CPS.mapRWST (l f)
92− {-# INLINE liftLocal #-}
93−
94−instance LiftLocal (S.Lazy.StateT s) where
55+instance LiftLocal (Lazy.StateT s)
95− liftLocal _ l f = S.Lazy.mapStateT (l f)
96− {-# INLINE liftLocal #-}
97−
98−instance LiftLocal (S.Strict.StateT s) where
56+instance LiftLocal (Strict.StateT s)
99− liftLocal _ l f = S.Strict.mapStateT (l f)
100− {-# INLINE liftLocal #-}
101−
102−instance Monoid w => LiftLocal (W.Lazy.WriterT w) where
57+instance Monoid w => LiftLocal (Lazy.WriterT w)
103− liftLocal _ l f = W.Lazy.mapWriterT (l f)
104− {-# INLINE liftLocal #-}
105−
106−instance Monoid w => LiftLocal (W.Strict.WriterT w) where
58+instance Monoid w => LiftLocal (Strict.WriterT w)
107− liftLocal _ l f = W.Strict.mapWriterT (l f)
108− {-# INLINE liftLocal #-}
109−
110−instance Monoid w => LiftLocal (W.CPS.WriterT w) where
111− liftLocal _ l f = W.CPS.mapWriterT (l f)
112− {-# INLINE liftLocal #-}
113−
114−#if MIN_VERSION_transformers(0,5,3)
115−instance Monoid w => LiftLocal (Acc.AccumT w) where
116− liftLocal _ l f = Acc.mapAccumT (l f)
117− {-# INLINE liftLocal #-}
118−#endif
src/Control/Monad/Trans/Lift/Pass.hs+24−79
@@ -1,11 +1,9 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2−{-# LANGUAGE RankNTypes #-}
2+{-# LANGUAGE TypeFamilies #-}
3−
3+{-# LANGUAGE UndecidableInstances #-}
4−-- | Lifting the 'pass' operation.
5module Control.Monad.Trans.Lift.Pass
4module Control.Monad.Trans.Lift.Pass
6 ( LiftPass(..)
5 ( LiftPass(..)
7 , Pass
6 , Pass
8− , defaultLiftPass
9 , module Control.Monad.Trans.Class
7 , module Control.Monad.Trans.Class
10 ) where
8 ) where
11
9
@@ -15,108 +13,55 @@ import Data.Monoid
15
13
16import Control.Monad.Signatures
14import Control.Monad.Signatures
17import Control.Monad.Trans.Class
15import Control.Monad.Trans.Class
16+import Control.Monad.Trans.Control
17+
18+import qualified Control.Monad.Trans.Except as E
19+import qualified Control.Monad.Trans.Identity as I
20+import qualified Control.Monad.Trans.Maybe as M
21+import qualified Control.Monad.Trans.Reader as R
22+import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
23+import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
24+import qualified Control.Monad.Trans.State.Lazy as S.Lazy
25+import qualified Control.Monad.Trans.State.Strict as S.Strict
26+import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
27+import qualified Control.Monad.Trans.Writer.Strict as W.Strict
18
28
19−import qualified Control.Monad.Trans.Except as E
20−import qualified Control.Monad.Trans.Identity as I
21−import qualified Control.Monad.Trans.Maybe as M
22−import qualified Control.Monad.Trans.Reader as R
23−import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
24−import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
25−import qualified Control.Monad.Trans.RWS.CPS.Internal as RWS.CPS
26−import qualified Control.Monad.Trans.State.Lazy as S.Lazy
27−import qualified Control.Monad.Trans.State.Strict as S.Strict
28−import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
29−import qualified Control.Monad.Trans.Writer.Strict as W.Strict
30−import qualified Control.Monad.Trans.Writer.CPS.Internal as W.CPS
31−
32−#if MIN_VERSION_transformers(0,5,3)
33−import qualified Control.Monad.Trans.Accum as Acc
34−#endif
35−
36−import Control.Monad.Trans.Lift.StT
37−
38−-- | The class of monad transformers capable of lifting 'pass'.
39class MonadTrans t => LiftPass t where
29class MonadTrans t => LiftPass t where
40− -- | Lift the 'pass' operation.
30+ type PassStT t a
41− -- Should satisfy the uniformity property
31+ type PassStT t a = StT t a
42− --
43− -- * @'lift' . 'liftPass' = 'liftPass' . 'lift'@
44− --
45− liftPass :: Monad m => Pass w m (StT t a) -> Pass w (t m) a
32+ liftPass :: Monad m => Pass w m (PassStT t a) -> Pass w (t m) a
46−
33+ -- TODO: investigate how MonadTransControl can be used for default definition
47−-- | Default definition for the 'liftPass' method.
48−defaultLiftPass
49− :: (Monad m, LiftPass n)
50− => (forall x . n m x -> t m x)
51− -- ^ Monad constructor
52− -> (forall o x . t o x -> n o x)
53− -- ^ Monad deconstructor
54− -> Pass w m (StT n a)
55− -> Pass w (t m) a
56−defaultLiftPass t unT pass m = t $ liftPass pass (unT m)
57
34
58instance LiftPass (E.ExceptT e) where
35instance LiftPass (E.ExceptT e) where
59 liftPass = E.liftPass
36 liftPass = E.liftPass
60− {-# INLINE liftPass #-}
61
37
62instance LiftPass I.IdentityT where
38instance LiftPass I.IdentityT where
63 liftPass = I.mapIdentityT
39 liftPass = I.mapIdentityT
64− {-# INLINE liftPass #-}
65
40
66instance LiftPass M.MaybeT where
41instance LiftPass M.MaybeT where
67 liftPass = M.liftPass
42 liftPass = M.liftPass
68− {-# INLINE liftPass #-}
69
43
70instance LiftPass (R.ReaderT r) where
44instance LiftPass (R.ReaderT r) where
71 liftPass = R.mapReaderT
45 liftPass = R.mapReaderT
72− {-# INLINE liftPass #-}
73
46
74instance LiftPass (S.Lazy.StateT s) where
47instance LiftPass (S.Lazy.StateT s) where
75 liftPass = S.Lazy.liftPass
48 liftPass = S.Lazy.liftPass
76− {-# INLINE liftPass #-}
77
49
78instance LiftPass (S.Strict.StateT s) where
50instance LiftPass (S.Strict.StateT s) where
79 liftPass = S.Strict.liftPass
51 liftPass = S.Strict.liftPass
80− {-# INLINE liftPass #-}
81
52
82instance Monoid w' => LiftPass (RWS.Lazy.RWST r w' s) where
53instance Monoid w' => LiftPass (RWS.Lazy.RWST r w' s) where
83− liftPass pass m = RWS.Lazy.RWST $ \r s -> pass $ do
54+ liftPass = error "TODO"
84− ~((a, f), w', s') <- RWS.Lazy.runRWST m r s
85− return ((a, w', s'), f)
86− {-# INLINE liftPass #-}
87
55
88instance Monoid w' => LiftPass (RWS.Strict.RWST r w' s) where
56instance Monoid w' => LiftPass (RWS.Strict.RWST r w' s) where
89− liftPass pass m = RWS.Strict.RWST $ \r s -> pass $ do
57+ liftPass = error "TODO"
90− ((a, f), w', s') <- RWS.Strict.runRWST m r s
91− return ((a, w', s'), f)
92− {-# INLINE liftPass #-}
93−
94−instance Monoid w' => LiftPass (RWS.CPS.RWST r w' s) where
95− liftPass pass m = RWS.CPS.RWST $ \r w_ s -> pass $ do
96− ((a, f), w', s') <- RWS.CPS.unRWST m r w_ s
97− return ((a, w', s'), f)
98− {-# INLINE liftPass #-}
99
58
100instance Monoid w' => LiftPass (W.Lazy.WriterT w') where
59instance Monoid w' => LiftPass (W.Lazy.WriterT w') where
101 liftPass pass m = W.Lazy.WriterT $ pass $ do
60 liftPass pass m = W.Lazy.WriterT $ pass $ do
102− ~((a, f), w') <- W.Lazy.runWriterT m
61+ ~((a, f), w) <- W.Lazy.runWriterT m
103− return ((a, w'), f)
62+ return ((a, w), f)
104− {-# INLINE liftPass #-}
105
63
106instance Monoid w' => LiftPass (W.Strict.WriterT w') where
64instance Monoid w' => LiftPass (W.Strict.WriterT w') where
107 liftPass pass m = W.Strict.WriterT $ pass $ do
65 liftPass pass m = W.Strict.WriterT $ pass $ do
108− ((a, f), w') <- W.Strict.runWriterT m
66+ ((a, f), w) <- W.Strict.runWriterT m
109− return ((a, w'), f)
67+ return ((a, w), f)
110− {-# INLINE liftPass #-}
111−
112−instance Monoid w' => LiftPass (W.CPS.WriterT w') where
113− liftPass pass m = W.CPS.WriterT $ \w_ -> pass $ do
114− ((a, f), w') <- W.CPS.unWriterT m w_
115− return ((a, w'), f)
116− {-# INLINE liftPass #-}
117−
118−#if MIN_VERSION_transformers(0,5,3)
119−instance Monoid w' => LiftPass (Acc.AccumT w') where
120− liftPass = Acc.liftPass
121− {-# INLINE liftPass #-}
122−#endif
src/Control/Monad/Trans/Lift/StT.hsdeleted−46
@@ -1,46 +0,0 @@
1−{-# LANGUAGE CPP #-}
2−{-# LANGUAGE TypeFamilies #-}
3−{-# LANGUAGE KindSignatures #-}
4−
5−-- | The 'StT' type family.
6−module Control.Monad.Trans.Lift.StT (StT) where
7−
8−import qualified Control.Monad.Trans.Except as E
9−import qualified Control.Monad.Trans.Identity as I
10−import qualified Control.Monad.Trans.List as L
11−import qualified Control.Monad.Trans.Maybe as M
12−import qualified Control.Monad.Trans.Reader as R
13−import qualified Control.Monad.Trans.RWS.Lazy as RWS.Lazy
14−import qualified Control.Monad.Trans.RWS.Strict as RWS.Strict
15−import qualified Control.Monad.Trans.RWS.CPS as RWS.CPS
16−import qualified Control.Monad.Trans.State.Lazy as S.Lazy
17−import qualified Control.Monad.Trans.State.Strict as S.Strict
18−import qualified Control.Monad.Trans.Writer.Lazy as W.Lazy
19−import qualified Control.Monad.Trans.Writer.Strict as W.Strict
20−import qualified Control.Monad.Trans.Writer.CPS as W.CPS
21−
22−#if MIN_VERSION_transformers(0,5,3)
23−import qualified Control.Monad.Trans.Accum as Acc
24−#endif
25−
26−-- | Internal state of a monad transformer.
27−-- Same as @StT@ from the @monad-control@ package.
28−type family StT (t :: (* -> *) -> (* -> *)) (a :: *) :: *
29−
30−type instance StT (E.ExceptT e) a = Either e a
31−type instance StT I.IdentityT a = a
32−type instance StT L.ListT a = [a]
33−type instance StT M.MaybeT a = Maybe a
34−type instance StT (R.ReaderT r) a = a
35−type instance StT (RWS.Lazy.RWST r w s) a = (a, s, w)
36−type instance StT (RWS.Strict.RWST r w s) a = (a, s, w)
37−type instance StT (RWS.CPS.RWST r w s) a = (a, s, w)
38−type instance StT (S.Lazy.StateT s) a = (a, s)
39−type instance StT (S.Strict.StateT s) a = (a, s)
40−type instance StT (W.Lazy.WriterT w) a = (a, w)
41−type instance StT (W.Strict.WriterT w) a = (a, w)
42−type instance StT (W.CPS.WriterT w) a = (a, w)
43−
44−#if MIN_VERSION_transformers(0,5,3)
45−type instance StT (Acc.AccumT w) a = (a, w)
46−#endif
stack-7.8.3.yamldeleted−7
@@ -1,7 +0,0 @@
1−flags: {}
2−packages:
3−- '.'
4−resolver: lts-2.22
5−extra-deps:
6−- transformers-0.4.2.0
7−- writer-cps-transformers-0.1.1.3
stack.yamldeleted−4
@@ -1,4 +0,0 @@
1−flags: {}
2−packages:
3−- '.'
4−resolver: nightly-2018-03-17
transformers-lift.cabal+16−21
@@ -1,19 +1,16 @@
1−cabal-version: 2.2
2name: transformers-lift
1name: transformers-lift
3−version: 0.2.0.2
2+version: 0.0.0.0
4synopsis: Ad-hoc type classes for lifting
3synopsis: Ad-hoc type classes for lifting
5−description:
4+-- description:
6− This simple and lightweight library provides type classes
7− for lifting monad transformer operations.
8−
9−-- license: BSD3
5+license: BSD3
10−-- ^ unfortunately have to comment this line because of cabal2nix
11license-file: LICENSE
6license-file: LICENSE
12−author: Vladislav Zavialov
7+author: Index Int
13−maintainer: Vladislav Zavialov <vlad.z.4096@gmail.com>
8+maintainer: vlad.z.4096@gmail.com
9+-- copyright:
14category: Control
10category: Control
15−bug-reports: https://github.com/int-index/transformers-lift/issues
16build-type: Simple
11build-type: Simple
12+-- extra-source-files:
13+cabal-version: >=1.10
17
14
18library
15library
19 exposed-modules: Control.Monad.Trans.Lift.Local
16 exposed-modules: Control.Monad.Trans.Lift.Local
@@ -21,20 +18,18 @@ library
21 Control.Monad.Trans.Lift.Catch
18 Control.Monad.Trans.Lift.Catch
22 Control.Monad.Trans.Lift.Listen
19 Control.Monad.Trans.Lift.Listen
23 Control.Monad.Trans.Lift.Pass
20 Control.Monad.Trans.Lift.Pass
24− Control.Monad.Trans.Lift.StT
21+ -- other-modules:
25−
26− build-depends: base >=4.8 && <4.13
22+ build-depends: base >=4.7 && <4.9
27− , transformers >= 0.4.2.0 && <0.6
23+ , transformers >= 0.4.2
28− , writer-cps-transformers == 0.1.1.4
24+ , mmorph >= 1.0.4
29−
25+ , monad-control >= 1.0.0.4
30− mixins: transformers hiding
31− (Control.Monad.Trans.RWS.CPS, Control.Monad.Trans.Writer.CPS)
32
26
33 default-language: Haskell2010
27 default-language: Haskell2010
34 other-extensions: CPP
28 other-extensions: CPP
29+ DefaultSignatures
35 RankNTypes
30 RankNTypes
36 TypeFamilies
31 TypeFamilies
37− KindSignatures
32+ UndecidableInstances
38
33
39 hs-source-dirs: src
34 hs-source-dirs: src
40− ghc-options: -Wall -fno-warn-deprecations
35+ ghc-options: -Wall