Skip to content

Commit f0fa685

Browse files
authored
allow building with transformers >= 0.6 (#56)
1 parent a405009 commit f0fa685

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/Unbound/Generics/LocallyNameless/Fresh.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import Control.Monad.Fix (MonadFix)
3030
#endif
3131
import Control.Monad.Trans
3232
import Control.Monad.Trans.Except
33+
#if !MIN_VERSION_transformers(0,6,0)
3334
import Control.Monad.Trans.Error
35+
#endif
3436
import Control.Monad.Trans.Maybe
3537
import Control.Monad.Trans.Reader
3638
import Control.Monad.Trans.State.Lazy as Lazy
@@ -119,8 +121,10 @@ instance Monad m => Fresh (FreshMT m) where
119121
return $ (Fn s n)
120122
fresh nm@(Bn {}) = return nm
121123

124+
#if !MIN_VERSION_transformers(0,6,0)
122125
instance (Error e, Fresh m) => Fresh (ErrorT e m) where
123126
fresh = lift . fresh
127+
#endif
124128

125129
instance Fresh m => Fresh (ExceptT e m) where
126130
fresh = lift . fresh

src/Unbound/Generics/LocallyNameless/LFresh.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ import Control.Monad.Identity
7777
import Control.Applicative (Applicative, Alternative)
7878

7979
import Control.Monad.Trans.Cont
80+
#if !MIN_VERSION_transformers(0,6,0)
8081
import Control.Monad.Trans.Error
82+
#endif
8183
import Control.Monad.Trans.Except
8284
import Control.Monad.Trans.Identity
85+
#if !MIN_VERSION_transformers(0,6,0)
8386
import Control.Monad.Trans.List
87+
#endif
8488
import Control.Monad.Trans.Maybe
8589
import Control.Monad.Trans.State.Lazy as Lazy
8690
import Control.Monad.Trans.State.Strict as Strict
@@ -164,10 +168,12 @@ instance LFresh m => LFresh (ContT r m) where
164168
avoid = mapContT . avoid
165169
getAvoids = lift getAvoids
166170

171+
#if !MIN_VERSION_transformers(0,6,0)
167172
instance (Error e, LFresh m) => LFresh (ErrorT e m) where
168173
lfresh = lift . lfresh
169174
avoid = mapErrorT . avoid
170175
getAvoids = lift getAvoids
176+
#endif
171177

172178
instance LFresh m => LFresh (ExceptT e m) where
173179
lfresh = lift . lfresh
@@ -179,10 +185,12 @@ instance LFresh m => LFresh (IdentityT m) where
179185
avoid = mapIdentityT . avoid
180186
getAvoids = lift getAvoids
181187

188+
#if !MIN_VERSION_transformers(0,6,0)
182189
instance LFresh m => LFresh (ListT m) where
183190
lfresh = lift . lfresh
184191
avoid = mapListT . avoid
185192
getAvoids = lift getAvoids
193+
#endif
186194

187195
instance LFresh m => LFresh (MaybeT m) where
188196
lfresh = lift . lfresh

unbound-generics.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ library
5656
template-haskell >= 2.8.0.0,
5757
deepseq >= 1.3.0.0,
5858
mtl >= 2.1,
59-
transformers >= 0.3 && < 0.6,
59+
transformers >= 0.3 && < 0.7,
6060
transformers-compat >= 0.3,
6161
containers >= 0.5 && < 0.7,
6262
contravariant >= 0.5,

0 commit comments

Comments
 (0)