on master help sign in
Instance search is now more strict
da52dc7Index Int
CHANGELOG.md+1
@@ -6,6 +6,7 @@
6* Replace `Control.Ether.Wrapped` with `Control.Monad.Trans.Ether.Dispatch`.
6* Replace `Control.Ether.Wrapped` with `Control.Monad.Trans.Ether.Dispatch`.
7* `MonadThrow`, `MonadCatch`, `MonadMask` instances.
7* `MonadThrow`, `MonadCatch`, `MonadMask` instances.
8* Drop `newtype-generics`.
8* Drop `newtype-generics`.
9+* Instance search is now more strict.
9
10
10
11
110.3.1.1
120.3.1.1
src/Control/Monad/Ether/Except/Class.hs+2−1
@@ -9,6 +9,7 @@
9{-# LANGUAGE FlexibleInstances #-}
9{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
11{-# LANGUAGE FunctionalDependencies #-}
11{-# LANGUAGE FunctionalDependencies #-}
12+{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE PolyKinds #-}
13{-# LANGUAGE PolyKinds #-}
13
14
14-- | See "Control.Monad.Except".
15-- | See "Control.Monad.Except".
@@ -31,7 +32,7 @@ class Monad m => MonadExcept tag e m | m tag -> e where
31 -- normal execution.
32 -- normal execution.
32 catch :: proxy tag -> m a -> (e -> m a) -> m a
33 catch :: proxy tag -> m a -> (e -> m a) -> m a
33
34
34−instance Monad m => MonadExcept tag e (E.ExceptT tag e m) where
35+instance (Monad m, e ~ e') => MonadExcept tag e (E.ExceptT tag e' m) where
35 throw = E.throw
36 throw = E.throw
36 catch = E.catch
37 catch = E.catch
37
38
src/Control/Monad/Ether/Reader/Class.hs+2−1
@@ -9,6 +9,7 @@
9{-# LANGUAGE FlexibleInstances #-}
9{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
11{-# LANGUAGE FunctionalDependencies #-}
11{-# LANGUAGE FunctionalDependencies #-}
12+{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE PolyKinds #-}
13{-# LANGUAGE PolyKinds #-}
13
14
14-- | See "Control.Monad.Reader.Class".
15-- | See "Control.Monad.Reader.Class".
@@ -57,7 +58,7 @@ asks
57 -> m a
58 -> m a
58asks = reader
59asks = reader
59
60
60−instance Monad m => MonadReader tag r (R.ReaderT tag r m) where
61+instance (Monad m, r ~ r') => MonadReader tag r (R.ReaderT tag r' m) where
61 ask = R.ask
62 ask = R.ask
62 local = R.local
63 local = R.local
63 reader = R.reader
64 reader = R.reader
src/Control/Monad/Ether/State/Class.hs+3−2
@@ -9,6 +9,7 @@
9{-# LANGUAGE FlexibleInstances #-}
9{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
11{-# LANGUAGE FunctionalDependencies #-}
11{-# LANGUAGE FunctionalDependencies #-}
12+{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE PolyKinds #-}
13{-# LANGUAGE PolyKinds #-}
13
14
14-- | See "Control.Monad.State.Class".
15-- | See "Control.Monad.State.Class".
@@ -53,12 +54,12 @@ modify t f = state t (\s -> ((), f s))
53gets :: MonadState tag s m => proxy tag -> (s -> a) -> m a
54gets :: MonadState tag s m => proxy tag -> (s -> a) -> m a
54gets t f = Util.fmap f (get t)
55gets t f = Util.fmap f (get t)
55
56
56−instance Monad m => MonadState tag s (S.L.StateT tag s m) where
57+instance (Monad m, s ~ s') => MonadState tag s (S.L.StateT tag s' m) where
57 get = S.L.get
58 get = S.L.get
58 put = S.L.put
59 put = S.L.put
59 state = S.L.state
60 state = S.L.state
60
61
61−instance Monad m => MonadState tag s (S.S.StateT tag s m) where
62+instance (Monad m, s ~ s') => MonadState tag s (S.S.StateT tag s' m) where
62 get = S.S.get
63 get = S.S.get
63 put = S.S.put
64 put = S.S.put
64 state = S.S.state
65 state = S.S.state
src/Control/Monad/Ether/Writer/Class.hs+2−1
@@ -9,6 +9,7 @@
9{-# LANGUAGE FlexibleInstances #-}
9{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
11{-# LANGUAGE FunctionalDependencies #-}
11{-# LANGUAGE FunctionalDependencies #-}
12+{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE PolyKinds #-}
13{-# LANGUAGE PolyKinds #-}
13
14
14-- | See "Control.Monad.Writer.Class".
15-- | See "Control.Monad.Writer.Class".
@@ -63,7 +64,7 @@ censor t f m = pass t $ do
63 a <- m
64 a <- m
64 return (a, f)
65 return (a, f)
65
66
66−instance (Monoid w, Monad m) => MonadWriter tag w (W.WriterT tag w m) where
67+instance (Monoid w, Monad m, w ~ w') => MonadWriter tag w (W.WriterT tag w' m) where
67 writer = W.writer
68 writer = W.writer
68 tell = W.tell
69 tell = W.tell
69 listen = W.listen
70 listen = W.listen
test/Regression/T4.hs−1
@@ -14,7 +14,6 @@ testEther = ask rTag
14runner r
14runner r
15 = flip (runReader rTag) (r' :: Int)
15 = flip (runReader rTag) (r' :: Int)
16 . flip (runReaderT rTag) (r :: Int)
16 . flip (runReaderT rTag) (r :: Int)
17− . flip (runReaderT rTag) (fromIntegral r' :: Integer)
18 where
17 where
19 r' = negate r
18 r' = negate r
20
19