on master help sign in
Implicit tagging via ambiguous
commit4c7619ac924186d3bf6a1799feb023a072277745 authorIndex Int <vlad.z.4096@gmail.com> dateSat 30 Apr 2016, 18:19 (10 years ago) parent8d8e5ff
6 files changed+81−87
ether.cabal+1−2 src/Control/Monad/Ether/Implicit/Except.hs+12−13 src/Control/Monad/Ether/Implicit/Reader.hs+14−15 src/Control/Monad/Ether/Implicit/State/Lazy.hs+19−20 src/Control/Monad/Ether/Implicit/State/Strict.hs+19−20 src/Control/Monad/Ether/Implicit/Writer.hs+16−17
ether.cabal+1−2
@@ -84,7 +84,7 @@ library
8484 MagicHash
8585 MultiParamTypeClasses
8686 ScopedTypeVariables
87− TemplateHaskell
87+ TypeApplications
8888 TypeFamilies
8989 TypeOperators
9090 UndecidableInstances
@@ -127,7 +127,6 @@ test-suite regression
127127 LambdaCase
128128 PolyKinds
129129 ScopedTypeVariables
130− TemplateHaskell
131130 TypeApplications
132131 TypeFamilies
133132 TypeOperators
src/Control/Monad/Ether/Implicit/Except.hs+12−13
@@ -1,6 +1,6 @@
11{-# LANGUAGE ConstraintKinds #-}
2+{-# LANGUAGE TypeApplications #-}
23{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE MagicHash #-}
44
55-- | See "Control.Monad.Ether.Except".
66
@@ -22,42 +22,41 @@ module Control.Monad.Ether.Implicit.Except
2222 , handleT
2323 ) where
2424
25−import GHC.Prim (Proxy#, proxy#)
26−import qualified Control.Monad.Ether.Except as Explicit
25+import qualified Control.Monad.Ether.Ambiguous.Except as A
2726
2827-- | See 'Control.Monad.Ether.Except.MonadExcept'.
29−type MonadExcept e = Explicit.MonadExcept e e
28+type MonadExcept e = A.MonadExcept e e
3029
3130-- | See 'Control.Monad.Ether.Except.throw'.
3231throw :: forall e m a . MonadExcept e m => e -> m a
33−throw = Explicit.throw (proxy# :: Proxy# e)
32+throw = A.throw @e
3433
3534-- | See 'Control.Monad.Ether.Except.catch'.
3635catch :: forall e m a . MonadExcept e m => m a -> (e -> m a) -> m a
37−catch = Explicit.catch (proxy# :: Proxy# e)
36+catch = A.catch @e
3837
3938-- | See 'Control.Monad.Ether.Except.Except'.
40−type Except e = Explicit.Except e e
39+type Except e = A.Except e e
4140
4241-- | See 'Control.Monad.Ether.Except.runExcept'.
4342runExcept :: Except e a -> Either e a
44−runExcept = Explicit.runExcept proxy#
43+runExcept = A.runExcept
4544
4645-- | See 'Control.Monad.Ether.Except.ExceptT'.
47−type ExceptT e = Explicit.ExceptT e e
46+type ExceptT e = A.ExceptT e e
4847
4948-- | See 'Control.Monad.Ether.Except.exceptT'.
5049exceptT :: m (Either e a) -> ExceptT e m a
51−exceptT = Explicit.exceptT proxy#
50+exceptT = A.exceptT
5251
5352-- | See 'Control.Monad.Ether.Except.runExceptT'.
5453runExceptT :: ExceptT e m a -> m (Either e a)
55−runExceptT = Explicit.runExceptT proxy#
54+runExceptT = A.runExceptT
5655
5756-- | See 'Control.Monad.Ether.Except.handle'.
5857handle :: (e -> a) -> Except e a -> a
59−handle = Explicit.handle proxy#
58+handle = A.handle
6059
6160-- | See 'Control.Monad.Ether.Except.handleT'.
6261handleT :: Functor m => (e -> a) -> ExceptT e m a -> m a
63−handleT = Explicit.handleT proxy#
62+handleT = A.handleT
src/Control/Monad/Ether/Implicit/Reader.hs+14−15
@@ -1,6 +1,6 @@
11{-# LANGUAGE ConstraintKinds #-}
2+{-# LANGUAGE TypeApplications #-}
23{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE MagicHash #-}
44
55-- | See "Control.Monad.Ether.Reader".
66
@@ -21,42 +21,41 @@ module Control.Monad.Ether.Implicit.Reader
2121 , runReaderT
2222 ) where
2323
24−import GHC.Prim (Proxy#, proxy#)
25−import qualified Control.Monad.Ether.Reader as Explicit
24+import qualified Control.Monad.Ether.Ambiguous.Reader as A
2625
2726-- | See 'Control.Monad.Ether.Reader.ReaderT'.
28−type ReaderT r = Explicit.ReaderT r r
29−
30−-- | See 'Control.Monad.Ether.Reader.Reader'.
31−type Reader r = Explicit.Reader r r
27+type ReaderT r = A.ReaderT r r
3228
3329-- | See 'Control.Monad.Ether.Reader.readerT'.
3430readerT :: (r -> m a) -> ReaderT r m a
35−readerT = Explicit.readerT proxy#
31+readerT = A.readerT
3632
3733-- | See 'Control.Monad.Ether.Reader.runReaderT'.
3834runReaderT :: ReaderT r m a -> r -> m a
39−runReaderT = Explicit.runReaderT proxy#
35+runReaderT = A.runReaderT
36+
37+-- | See 'Control.Monad.Ether.Reader.Reader'.
38+type Reader r = A.Reader r r
4039
4140-- | See 'Control.Monad.Ether.Reader.runReader'.
4241runReader :: Reader r a -> r -> a
43−runReader = Explicit.runReader proxy#
42+runReader = A.runReader
4443
4544-- | See 'Control.Monad.Ether.Reader.MonadReader'.
46−type MonadReader r = Explicit.MonadReader r r
45+type MonadReader r = A.MonadReader r r
4746
4847-- | See 'Control.Monad.Ether.Reader.local'.
4948local :: forall r m a . MonadReader r m => (r -> r) -> m a -> m a
50−local = Explicit.local (proxy# :: Proxy# r)
49+local = A.local @r
5150
5251-- | See 'Control.Monad.Ether.Reader.ask'.
5352ask :: forall r m . MonadReader r m => m r
54−ask = Explicit.ask (proxy# :: Proxy# r)
53+ask = A.ask @r
5554
5655-- | See 'Control.Monad.Ether.Reader.reader'.
5756reader :: forall r m a . MonadReader r m => (r -> a) -> m a
58−reader = Explicit.reader (proxy# :: Proxy# r)
57+reader = A.reader @r
5958
6059-- | See 'Control.Monad.Ether.Reader.asks'.
6160asks :: forall r m a . MonadReader r m => (r -> a) -> m a
62−asks = Explicit.asks (proxy# :: Proxy# r)
61+asks = A.asks @r
src/Control/Monad/Ether/Implicit/State/Lazy.hs+19−20
@@ -1,6 +1,6 @@
11{-# LANGUAGE ConstraintKinds #-}
2+{-# LANGUAGE TypeApplications #-}
23{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE MagicHash #-}
44
55-- | See "Control.Monad.Ether.State.Lazy".
66
@@ -26,62 +26,61 @@ module Control.Monad.Ether.Implicit.State.Lazy
2626 , execStateT
2727 ) where
2828
29−import GHC.Prim (Proxy#, proxy#)
30−import qualified Control.Monad.Ether.State.Lazy as Explicit
29+import qualified Control.Monad.Ether.Ambiguous.State.Lazy as A
3130
3231-- | See 'Control.Monad.Ether.State.Lazy.StateT'.
33−type StateT s = Explicit.StateT s s
34−
35−-- | See 'Control.Monad.Ether.State.Lazy.State'.
36−type State s = Explicit.State s s
32+type StateT s = A.StateT s s
3733
3834-- | See 'Control.Monad.Ether.State.Lazy.stateT'.
3935stateT :: (s -> m (a, s)) -> StateT s m a
40−stateT = Explicit.stateT proxy#
36+stateT = A.stateT
4137
4238-- | See 'Control.Monad.Ether.State.Lazy.runStateT'.
4339runStateT :: StateT s m a -> s -> m (a, s)
44−runStateT = Explicit.runStateT proxy#
40+runStateT = A.runStateT
4541
4642-- | See 'Control.Monad.Ether.State.Lazy.runState'.
4743runState :: State s a -> s -> (a, s)
48−runState = Explicit.runState proxy#
44+runState = A.runState
4945
5046-- | See 'Control.Monad.Ether.State.Lazy.evalStateT'.
5147evalStateT :: Monad m => StateT s m a -> s -> m a
52−evalStateT = Explicit.evalStateT proxy#
48+evalStateT = A.evalStateT
49+
50+-- | See 'Control.Monad.Ether.State.Lazy.State'.
51+type State s = A.State s s
5352
5453-- | See 'Control.Monad.Ether.State.Lazy.evalState'.
5554evalState :: State s a -> s -> a
56−evalState = Explicit.evalState proxy#
55+evalState = A.evalState
5756
5857-- | See 'Control.Monad.Ether.State.Lazy.execStateT'.
5958execStateT :: Monad m => StateT s m a -> s -> m s
60−execStateT = Explicit.execStateT proxy#
59+execStateT = A.execStateT
6160
6261-- | See 'Control.Monad.Ether.State.Lazy.execState'.
6362execState :: State s a -> s -> s
64−execState = Explicit.execState proxy#
63+execState = A.execState
6564
6665-- | See 'Control.Monad.Ether.State.Lazy.MonadState'.
67−type MonadState s = Explicit.MonadState s s
66+type MonadState s = A.MonadState s s
6867
6968-- | See 'Control.Monad.Ether.State.Lazy.get'.
7069get :: forall s m . MonadState s m => m s
71−get = Explicit.get (proxy# :: Proxy# s)
70+get = A.get @s
7271
7372-- | See 'Control.Monad.Ether.State.Lazy.gets'.
7473gets :: forall s m a . MonadState s m => (s -> a) -> m a
75−gets = Explicit.gets (proxy# :: Proxy# s)
74+gets = A.gets @s
7675
7776-- | See 'Control.Monad.Ether.State.Lazy.put'.
7877put :: forall s m . MonadState s m => s -> m ()
79−put = Explicit.put (proxy# :: Proxy# s)
78+put = A.put @s
8079
8180-- | See 'Control.Monad.Ether.State.Lazy.state'.
8281state :: forall s m a . MonadState s m => (s -> (a, s)) -> m a
83−state = Explicit.state (proxy# :: Proxy# s)
82+state = A.state @s
8483
8584-- | See 'Control.Monad.Ether.State.Lazy.modify'.
8685modify :: forall s m . MonadState s m => (s -> s) -> m ()
87−modify = Explicit.modify (proxy# :: Proxy# s)
86+modify = A.modify @s
src/Control/Monad/Ether/Implicit/State/Strict.hs+19−20
@@ -1,6 +1,6 @@
11{-# LANGUAGE ConstraintKinds #-}
2+{-# LANGUAGE TypeApplications #-}
23{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE MagicHash #-}
44
55-- | See "Control.Monad.Ether.State.Strict".
66
@@ -26,62 +26,61 @@ module Control.Monad.Ether.Implicit.State.Strict
2626 , execStateT
2727 ) where
2828
29−import GHC.Prim (Proxy#, proxy#)
30−import qualified Control.Monad.Ether.State.Strict as Explicit
29+import qualified Control.Monad.Ether.Ambiguous.State.Strict as A
3130
3231-- | See 'Control.Monad.Ether.State.Strict.StateT'.
33−type StateT s = Explicit.StateT s s
34−
35−-- | See 'Control.Monad.Ether.State.Strict.State'.
36−type State s = Explicit.State s s
32+type StateT s = A.StateT s s
3733
3834-- | See 'Control.Monad.Ether.State.Strict.stateT'.
3935stateT :: (s -> m (a, s)) -> StateT s m a
40−stateT = Explicit.stateT proxy#
36+stateT = A.stateT
4137
4238-- | See 'Control.Monad.Ether.State.Strict.runStateT'.
4339runStateT :: StateT s m a -> s -> m (a, s)
44−runStateT = Explicit.runStateT proxy#
40+runStateT = A.runStateT
4541
4642-- | See 'Control.Monad.Ether.State.Strict.runState'.
4743runState :: State s a -> s -> (a, s)
48−runState = Explicit.runState proxy#
44+runState = A.runState
4945
5046-- | See 'Control.Monad.Ether.State.Strict.evalStateT'.
5147evalStateT :: Monad m => StateT s m a -> s -> m a
52−evalStateT = Explicit.evalStateT proxy#
48+evalStateT = A.evalStateT
49+
50+-- | See 'Control.Monad.Ether.State.Strict.State'.
51+type State s = A.State s s
5352
5453-- | See 'Control.Monad.Ether.State.Strict.evalState'.
5554evalState :: State s a -> s -> a
56−evalState = Explicit.evalState proxy#
55+evalState = A.evalState
5756
5857-- | See 'Control.Monad.Ether.State.Strict.execStateT'.
5958execStateT :: Monad m => StateT s m a -> s -> m s
60−execStateT = Explicit.execStateT proxy#
59+execStateT = A.execStateT
6160
6261-- | See 'Control.Monad.Ether.State.Strict.execState'.
6362execState :: State s a -> s -> s
64−execState = Explicit.execState proxy#
63+execState = A.execState
6564
6665-- | See 'Control.Monad.Ether.State.Strict.MonadState'.
67−type MonadState s = Explicit.MonadState s s
66+type MonadState s = A.MonadState s s
6867
6968-- | See 'Control.Monad.Ether.State.Strict.get'.
7069get :: forall s m . MonadState s m => m s
71−get = Explicit.get (proxy# :: Proxy# s)
70+get = A.get @s
7271
7372-- | See 'Control.Monad.Ether.State.Strict.gets'.
7473gets :: forall s m a . MonadState s m => (s -> a) -> m a
75−gets = Explicit.gets (proxy# :: Proxy# s)
74+gets = A.gets @s
7675
7776-- | See 'Control.Monad.Ether.State.Strict.put'.
7877put :: forall s m . MonadState s m => s -> m ()
79−put = Explicit.put (proxy# :: Proxy# s)
78+put = A.put @s
8079
8180-- | See 'Control.Monad.Ether.State.Strict.state'.
8281state :: forall s m a . MonadState s m => (s -> (a, s)) -> m a
83−state = Explicit.state (proxy# :: Proxy# s)
82+state = A.state @s
8483
8584-- | See 'Control.Monad.Ether.State.Strict.modify'.
8685modify :: forall s m . MonadState s m => (s -> s) -> m ()
87−modify = Explicit.modify (proxy# :: Proxy# s)
86+modify = A.modify @s
src/Control/Monad/Ether/Implicit/Writer.hs+16−17
@@ -1,6 +1,6 @@
11{-# LANGUAGE ConstraintKinds #-}
2+{-# LANGUAGE TypeApplications #-}
23{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE MagicHash #-}
44
55-- | See "Control.Monad.Ether.Writer".
66
@@ -25,58 +25,57 @@ module Control.Monad.Ether.Implicit.Writer
2525 , execWriterT
2626 ) where
2727
28−import GHC.Prim (Proxy#, proxy#)
29−import qualified Control.Monad.Ether.Writer as Explicit
28+import qualified Control.Monad.Ether.Ambiguous.Writer as A
3029
3130-- | See 'Control.Monad.Ether.Writer.MonadWriter'.
32−type MonadWriter w = Explicit.MonadWriter w w
31+type MonadWriter w = A.MonadWriter w w
3332
3433-- | See 'Control.Monad.Ether.Writer.writer'.
3534writer :: forall w m a . MonadWriter w m => (a, w) -> m a
36−writer = Explicit.writer (proxy# :: Proxy# w)
35+writer = A.writer @w
3736
3837-- | See 'Control.Monad.Ether.Writer.tell'.
3938tell :: forall w m . MonadWriter w m => w -> m ()
40−tell = Explicit.tell (proxy# :: Proxy# w)
39+tell = A.tell @w
4140
4241-- | See 'Control.Monad.Ether.Writer.listen'.
4342listen :: forall w m a . MonadWriter w m => m a -> m (a, w)
44−listen = Explicit.listen (proxy# :: Proxy# w)
43+listen = A.listen @w
4544
4645-- | See 'Control.Monad.Ether.Writer.pass'.
4746pass :: forall w m a . MonadWriter w m => m (a, w -> w) -> m a
48−pass = Explicit.pass (proxy# :: Proxy# w)
47+pass = A.pass @w
4948
5049-- | See 'Control.Monad.Ether.Writer.listens'.
5150listens :: forall w m a b . MonadWriter w m => (w -> b) -> m a -> m (a, b)
52−listens = Explicit.listens (proxy# :: Proxy# w)
51+listens = A.listens @w
5352
5453-- | See 'Control.Monad.Ether.Writer.censor'.
5554censor :: forall w m a . MonadWriter w m => (w -> w) -> m a -> m a
56−censor = Explicit.censor (proxy# :: Proxy# w)
55+censor = A.censor @w
5756
5857-- | See 'Control.Monad.Ether.Writer.Writer'.
59−type Writer w = Explicit.Writer w w
58+type Writer w = A.Writer w w
6059
6160-- | See 'Control.Monad.Ether.Writer.runWriter'.
6261runWriter :: Writer w a -> (a, w)
63−runWriter = Explicit.runWriter proxy#
62+runWriter = A.runWriter
6463
6564-- | See 'Control.Monad.Ether.Writer.execWriter'.
6665execWriter :: Writer w a -> w
67−execWriter = Explicit.execWriter proxy#
66+execWriter = A.execWriter
6867
6968-- | See 'Control.Monad.Ether.Writer.WriterT'.
70−type WriterT w = Explicit.WriterT w w
69+type WriterT w = A.WriterT w w
7170
7271-- | See 'Control.Monad.Ether.Writer.writerT'.
7372writerT :: m (a, w) -> WriterT w m a
74−writerT = Explicit.writerT proxy#
73+writerT = A.writerT
7574
7675-- | See 'Control.Monad.Ether.Writer.runWriterT'.
7776runWriterT :: WriterT w m a -> m (a, w)
78−runWriterT = Explicit.runWriterT proxy#
77+runWriterT = A.runWriterT
7978
8079-- | See 'Control.Monad.Ether.Writer.execWriterT'.
8180execWriterT :: Monad m => WriterT w m a -> m w
82−execWriterT = Explicit.execWriterT proxy#
81+execWriterT = A.execWriterT