on master help sign in
Update documentation
bccf61cIndex Int
src/Control/Ether/TH.hs+11
@@ -1,4 +1,7 @@
1{-# LANGUAGE TemplateHaskell #-}
1{-# LANGUAGE TemplateHaskell #-}
2+
3+-- | Template haskell utilities.
4+
2module Control.Ether.TH
5module Control.Ether.TH
3 ( ethereal
6 ( ethereal
4 , fmapN
7 , fmapN
@@ -38,10 +41,18 @@ ethereal strTagName strTagProxyName = do
38 (tagProxySig, tagProxyVal) <- proxySimple tagProxyName tag
41 (tagProxySig, tagProxyVal) <- proxySimple tagProxyName tag
39 return [tagDecl, tagProxySig, tagProxyVal]
42 return [tagDecl, tagProxySig, tagProxyVal]
40
43
44+-- |
45+-- Compose 'fmap' @n@ times.
46+--
47+-- @$('fmapN' 5) = fmap.fmap.fmap.fmap.fmap@
41fmapN :: Int -> TH.ExpQ
48fmapN :: Int -> TH.ExpQ
42fmapN 0 = [|id|]
49fmapN 0 = [|id|]
43fmapN n = TH.infixApp [|fmap|] [|(.)|] (fmapN (n - 1))
50fmapN n = TH.infixApp [|fmap|] [|(.)|] (fmapN (n - 1))
44
51
52+-- |
53+-- 'fmap' a function @n@ levels deep.
54+--
55+-- @$('deepN' 3 [| f |]) = $('fmapN' 3) f ($('fmapN' 2) f ($('fmapN' 1) f id))@
45deepN :: Int -> TH.ExpQ -> TH.ExpQ
56deepN :: Int -> TH.ExpQ -> TH.ExpQ
46deepN 0 _ = [|id|]
57deepN 0 _ = [|id|]
47deepN n f = [| $(fmapN n) $f $(deepN (n-1) f) |]
58deepN n f = [| $(fmapN n) $f $(deepN (n-1) f) |]
src/Control/Ether/Tagged.hs+6−1
@@ -9,6 +9,9 @@
9{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE MultiParamTypeClasses #-}
10{-# LANGUAGE FunctionalDependencies #-}
10{-# LANGUAGE FunctionalDependencies #-}
11{-# LANGUAGE DefaultSignatures #-}
11{-# LANGUAGE DefaultSignatures #-}
12+
13+-- | Type-level machinery for tag manipulation.
14+
12module Control.Ether.Tagged
15module Control.Ether.Tagged
13 ( Taggable(..)
16 ( Taggable(..)
14 , Tagged(..)
17 , Tagged(..)
@@ -43,7 +46,7 @@ import qualified Control.Monad.Trans.Writer.Strict as Trans.Strict
43-- |
46-- |
44-- The main purpose of the 'UniqueTag' class is to provide clear error
47-- The main purpose of the 'UniqueTag' class is to provide clear error
45-- messages when the tag uniqueness property is violated. You should never
48-- messages when the tag uniqueness property is violated. You should never
46−-- provide instances for it unless you know what you're doing.
49+-- write instances for it unless you know what you're doing.
47class UniqueTag a
50class UniqueTag a
48
51
49type family IsUnique (x :: k) (as :: [k]) :: Constraint where
52type family IsUnique (x :: k) (as :: [k]) :: Constraint where
@@ -91,6 +94,8 @@ type family Inners' m where
91 Inners' 'Nothing = '[]
94 Inners' 'Nothing = '[]
92 Inners' ('Just n) = n ': Inners n
95 Inners' ('Just n) = n ': Inners n
93
96
97+-- | The 'Inners' type function recursively applies 'Inner' and returns the
98+-- results in a type-level list.
94type Inners m = Inners' (Inner m)
99type Inners m = Inners' (Inner m)
95
100
96instance Taggable IO
101instance Taggable IO
src/Control/Ether/Wrapped.hs+27−4
@@ -4,7 +4,28 @@
4{-# LANGUAGE UndecidableInstances #-}
4{-# LANGUAGE UndecidableInstances #-}
5{-# LANGUAGE ScopedTypeVariables #-}
5{-# LANGUAGE ScopedTypeVariables #-}
6{-# LANGUAGE GeneralizedNewtypeDeriving #-}
6{-# LANGUAGE GeneralizedNewtypeDeriving #-}
7+
8+{- |
9+Annotating monads with tags to turn untagged constraints into tagged ones.
10+
11+> import qualified Control.Monad.State as T
12+> import Control.Ether.TH (ethereal)
13+> import Control.Monad.Ether.State (MonadState)
14+> import Control.Ether.Wrapped (ethered)
15+>
16+> ethereal "Foo" "foo"
17+>
18+> f :: T.MonadState Int m => m String
19+> f = fmap show T.get
20+>
21+> g :: MonadState Foo Int m => m String
22+> g = ethered foo f
23+-}
24+
7−module Control.Ether.Wrapped where
25+module Control.Ether.Wrapped
26+ ( WrappedEther(..)
27+ , ethered
28+ ) where
8
29
9import Data.Proxy (Proxy(Proxy))
30import Data.Proxy (Proxy(Proxy))
10import Control.Applicative (Alternative)
31import Control.Applicative (Alternative)
@@ -21,10 +42,15 @@ import qualified Control.Monad.State as Class
21import qualified Control.Monad.Except as Class
42import qualified Control.Monad.Except as Class
22import qualified Control.Monad.Writer as Class
43import qualified Control.Monad.Writer as Class
23
44
45+-- | Wrap a monad to attach a tag to it.
24newtype WrappedEther tag m a = WrapEther { unwrapEther :: m a }
46newtype WrappedEther tag m a = WrapEther { unwrapEther :: m a }
25 deriving ( Functor, Applicative, Alternative, Monad, MonadPlus
47 deriving ( Functor, Applicative, Alternative, Monad, MonadPlus
26 , MonadFix, MonadIO )
48 , MonadFix, MonadIO )
27
49
50+-- | Annotate a polymorphic monadic computation with a tag.
51+ethered :: proxy tag -> WrappedEther tag m a -> m a
52+ethered _proxy = unwrapEther
53+
28instance MonadReader tag r m => Class.MonadReader r (WrappedEther tag m) where
54instance MonadReader tag r m => Class.MonadReader r (WrappedEther tag m) where
29 ask = WrapEther $ ask (Proxy :: Proxy tag)
55 ask = WrapEther $ ask (Proxy :: Proxy tag)
30 local f = WrapEther . local (Proxy :: Proxy tag) f . unwrapEther
56 local f = WrapEther . local (Proxy :: Proxy tag) f . unwrapEther
@@ -58,6 +84,3 @@ instance MonadWriter tag w m => MonadWriter tag w (WrappedEther tag' m) where
58 tell t = WrapEther . tell t
84 tell t = WrapEther . tell t
59 listen t = WrapEther . listen t . unwrapEther
85 listen t = WrapEther . listen t . unwrapEther
60 pass t = WrapEther . pass t . unwrapEther
86 pass t = WrapEther . pass t . unwrapEther
61−
62−ethered :: proxy tag -> WrappedEther tag m a -> m a
63−ethered _proxy = unwrapEther
src/Control/Monad/Ether/Except.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.Except".
3+
1module Control.Monad.Ether.Except
4module Control.Monad.Ether.Except
2 (
5 (
3 -- * MonadExcept class
6 -- * MonadExcept class
src/Control/Monad/Ether/Except/Class.hs+5
@@ -10,6 +10,9 @@
10{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE RankNTypes #-}
11{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
13+
14+-- | See "Control.Monad.Except".
15+
13module Control.Monad.Ether.Except.Class
16module Control.Monad.Ether.Except.Class
14 ( MonadExcept(..)
17 ( MonadExcept(..)
15 ) where
18 ) where
@@ -36,6 +39,8 @@ import qualified Control.Monad.Trans.State.Strict as Trans.S.Strict
36import qualified Control.Monad.Trans.Writer.Lazy as Trans.W.Lazy
39import qualified Control.Monad.Trans.Writer.Lazy as Trans.W.Lazy
37import qualified Control.Monad.Trans.Writer.Strict as Trans.W.Strict
40import qualified Control.Monad.Trans.Writer.Strict as Trans.W.Strict
38
41
42+
43+-- | See 'Control.Monad.Except.MonadError'.
39class Monad m => MonadExcept tag e m | m tag -> e where
44class Monad m => MonadExcept tag e m | m tag -> e where
40
45
41 -- | Is used within a monadic computation to begin exception processing.
46 -- | Is used within a monadic computation to begin exception processing.
src/Control/Monad/Ether/Implicit/Except.hs+13
@@ -1,5 +1,8 @@
1{-# LANGUAGE ConstraintKinds #-}
1{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE ScopedTypeVariables #-}
2{-# LANGUAGE ScopedTypeVariables #-}
3+
4+-- | See "Control.Monad.Ether.Except".
5+
3module Control.Monad.Ether.Implicit.Except
6module Control.Monad.Ether.Implicit.Except
4 (
7 (
5 -- * MonadExcept class
8 -- * MonadExcept class
@@ -19,26 +22,36 @@ module Control.Monad.Ether.Implicit.Except
19import Data.Proxy
22import Data.Proxy
20import qualified Control.Monad.Ether.Except as Explicit
23import qualified Control.Monad.Ether.Except as Explicit
21
24
25+-- | See 'Control.Monad.Ether.Except.MonadExcept'.
22type MonadExcept e = Explicit.MonadExcept e e
26type MonadExcept e = Explicit.MonadExcept e e
23
27
28+-- | See 'Control.Monad.Ether.Except.throw'.
24throw :: forall e m a . MonadExcept e m => e -> m a
29throw :: forall e m a . MonadExcept e m => e -> m a
25throw = Explicit.throw (Proxy :: Proxy e)
30throw = Explicit.throw (Proxy :: Proxy e)
26
31
32+-- | See 'Control.Monad.Ether.Except.catch'.
27catch :: forall e m a . MonadExcept e m => m a -> (e -> m a) -> m a
33catch :: forall e m a . MonadExcept e m => m a -> (e -> m a) -> m a
28catch = Explicit.catch (Proxy :: Proxy e)
34catch = Explicit.catch (Proxy :: Proxy e)
29
35
36+-- | See 'Control.Monad.Ether.Except.Except'.
30type Except e = Explicit.Except e e
37type Except e = Explicit.Except e e
31
38
39+-- | See 'Control.Monad.Ether.Except.runExcept'.
32runExcept :: Except e a -> Either e a
40runExcept :: Except e a -> Either e a
33runExcept = Explicit.runExcept Proxy
41runExcept = Explicit.runExcept Proxy
34
42
43+-- | See 'Control.Monad.Ether.Except.ExceptT'.
35type ExceptT e = Explicit.ExceptT e e
44type ExceptT e = Explicit.ExceptT e e
36
45
46+-- | See 'Control.Monad.Ether.Except.exceptT'.
37exceptT :: m (Either e a) -> ExceptT e m a
47exceptT :: m (Either e a) -> ExceptT e m a
38exceptT = Explicit.exceptT Proxy
48exceptT = Explicit.exceptT Proxy
39
49
50+-- | See 'Control.Monad.Ether.Except.runExceptT'.
40runExceptT :: ExceptT e m a -> m (Either e a)
51runExceptT :: ExceptT e m a -> m (Either e a)
41runExceptT = Explicit.runExceptT Proxy
52runExceptT = Explicit.runExceptT Proxy
42
53
54+-- | See 'Control.Monad.Ether.Except.mapExceptT'.
55+-- Note that due to implicit tagging the exception type cannot be changed.
43mapExceptT :: (m (Either e a) -> n (Either e b)) -> ExceptT e m a -> ExceptT e n b
56mapExceptT :: (m (Either e a) -> n (Either e b)) -> ExceptT e m a -> ExceptT e n b
44mapExceptT = Explicit.mapExceptT Proxy
57mapExceptT = Explicit.mapExceptT Proxy
src/Control/Monad/Ether/Implicit/Except/TH.hs+10
@@ -1,12 +1,22 @@
1{-# LANGUAGE TemplateHaskell #-}
1{-# LANGUAGE TemplateHaskell #-}
2+
3+-- | Template Haskell utilities for exception handling.
4+
2module Control.Monad.Ether.Implicit.Except.TH (try', try) where
5module Control.Monad.Ether.Implicit.Except.TH (try', try) where
3
6
4import qualified Language.Haskell.TH as TH
7import qualified Language.Haskell.TH as TH
5import Control.Ether.TH (deepN)
8import Control.Ether.TH (deepN)
6import Control.Monad.Ether.Implicit.Except
9import Control.Monad.Ether.Implicit.Except
7
10
11+-- | Basic building block for 'try'. Runs an 'ExceptT' with a handler.
8try' :: Functor m => ExceptT e m a -> (e -> a) -> m a
12try' :: Functor m => ExceptT e m a -> (e -> a) -> m a
9try' m h = either h id <$> runExceptT m
13try' m h = either h id <$> runExceptT m
10
14
15+-- | Handle @n@ exceptions with supplied handlers.
16+--
17+-- > $(try 3) monadicComputation
18+-- > (\Exception1 -> ...)
19+-- > (\Exception2 -> ...)
20+-- > (\Exception3 -> ...)
11try :: Int -> TH.ExpQ
21try :: Int -> TH.ExpQ
12try n = deepN n [|try'|]
22try n = deepN n [|try'|]
src/Control/Monad/Ether/Implicit/Reader.hs+15−1
@@ -1,5 +1,8 @@
1{-# LANGUAGE ConstraintKinds #-}
1{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE ScopedTypeVariables #-}
2{-# LANGUAGE ScopedTypeVariables #-}
3+
4+-- | See "Control.Monad.Ether.Reader".
5+
3module Control.Monad.Ether.Implicit.Reader
6module Control.Monad.Ether.Implicit.Reader
4 (
7 (
5 -- * MonadReader class
8 -- * MonadReader class
@@ -21,32 +24,43 @@ module Control.Monad.Ether.Implicit.Reader
21import Data.Proxy
24import Data.Proxy
22import qualified Control.Monad.Ether.Reader as Explicit
25import qualified Control.Monad.Ether.Reader as Explicit
23
26
27+-- | See 'Control.Monad.Ether.Reader.ReaderT'.
24type ReaderT r = Explicit.ReaderT r r
28type ReaderT r = Explicit.ReaderT r r
29+
30+-- | See 'Control.Monad.Ether.Reader.Reader'.
25type Reader r = Explicit.Reader r r
31type Reader r = Explicit.Reader r r
26
32
33+-- | See 'Control.Monad.Ether.Reader.readerT'.
27readerT :: (r -> m a) -> ReaderT r m a
34readerT :: (r -> m a) -> ReaderT r m a
28readerT = Explicit.readerT Proxy
35readerT = Explicit.readerT Proxy
29
36
37+-- | See 'Control.Monad.Ether.Reader.runReaderT'.
30runReaderT :: ReaderT r m a -> r -> m a
38runReaderT :: ReaderT r m a -> r -> m a
31runReaderT = Explicit.runReaderT Proxy
39runReaderT = Explicit.runReaderT Proxy
32
40
41+-- | See 'Control.Monad.Ether.Reader.runReader'.
33runReader :: Reader r a -> r -> a
42runReader :: Reader r a -> r -> a
34runReader = Explicit.runReader Proxy
43runReader = Explicit.runReader Proxy
35
44
45+-- | See 'Control.Monad.Ether.Reader.mapReaderT'.
36mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b
46mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b
37mapReaderT = Explicit.mapReaderT Proxy
47mapReaderT = Explicit.mapReaderT Proxy
38
48
49+-- | See 'Control.Monad.Ether.Reader.MonadReader'.
39type MonadReader r = Explicit.MonadReader r r
50type MonadReader r = Explicit.MonadReader r r
40
51
52+-- | See 'Control.Monad.Ether.Reader.local'.
41local :: forall m r a . MonadReader r m => (r -> r) -> m a -> m a
53local :: forall m r a . MonadReader r m => (r -> r) -> m a -> m a
42local = Explicit.local (Proxy :: Proxy r)
54local = Explicit.local (Proxy :: Proxy r)
43
55
56+-- | See 'Control.Monad.Ether.Reader.ask'.
44ask :: forall m r . MonadReader r m => m r
57ask :: forall m r . MonadReader r m => m r
45ask = Explicit.ask (Proxy :: Proxy r)
58ask = Explicit.ask (Proxy :: Proxy r)
46
59
60+-- | See 'Control.Monad.Ether.Reader.reader'.
47reader :: forall m r a . MonadReader r m => (r -> a) -> m a
61reader :: forall m r a . MonadReader r m => (r -> a) -> m a
48reader = Explicit.reader (Proxy :: Proxy r)
62reader = Explicit.reader (Proxy :: Proxy r)
49
63
64+-- | See 'Control.Monad.Ether.Reader.asks'.
50asks :: forall m r a . MonadReader r m => (r -> a) -> m a
65asks :: forall m r a . MonadReader r m => (r -> a) -> m a
51asks = Explicit.asks (Proxy :: Proxy r)
66asks = Explicit.asks (Proxy :: Proxy r)
52−
src/Control/Monad/Ether/Implicit/State.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.Ether.State".
3+
1module Control.Monad.Ether.Implicit.State
4module Control.Monad.Ether.Implicit.State
2 ( module Control.Monad.Ether.Implicit.State.Lazy
5 ( module Control.Monad.Ether.Implicit.State.Lazy
3 ) where
6 ) where
src/Control/Monad/Ether/Implicit/State/Lazy.hs+20
@@ -1,5 +1,8 @@
1{-# LANGUAGE ConstraintKinds #-}
1{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE ScopedTypeVariables #-}
2{-# LANGUAGE ScopedTypeVariables #-}
3+
4+-- | See "Control.Monad.Ether.State.Lazy".
5+
3module Control.Monad.Ether.Implicit.State.Lazy
6module Control.Monad.Ether.Implicit.State.Lazy
4 (
7 (
5 -- * MonadState class
8 -- * MonadState class
@@ -26,46 +29,63 @@ module Control.Monad.Ether.Implicit.State.Lazy
26import Data.Proxy
29import Data.Proxy
27import qualified Control.Monad.Ether.State.Lazy as Explicit
30import qualified Control.Monad.Ether.State.Lazy as Explicit
28
31
32+-- | See 'Control.Monad.Ether.State.Lazy.StateT'.
29type StateT s = Explicit.StateT s s
33type StateT s = Explicit.StateT s s
34+
35+-- | See 'Control.Monad.Ether.State.Lazy.State'.
30type State s = Explicit.State s s
36type State s = Explicit.State s s
31
37
38+-- | See 'Control.Monad.Ether.State.Lazy.stateT'.
32stateT :: (s -> m (a, s)) -> StateT s m a
39stateT :: (s -> m (a, s)) -> StateT s m a
33stateT = Explicit.stateT Proxy
40stateT = Explicit.stateT Proxy
34
41
42+-- | See 'Control.Monad.Ether.State.Lazy.runStateT'.
35runStateT :: StateT s m a -> s -> m (a, s)
43runStateT :: StateT s m a -> s -> m (a, s)
36runStateT = Explicit.runStateT Proxy
44runStateT = Explicit.runStateT Proxy
37
45
46+-- | See 'Control.Monad.Ether.State.Lazy.runState'.
38runState :: State s a -> s -> (a, s)
47runState :: State s a -> s -> (a, s)
39runState = Explicit.runState Proxy
48runState = Explicit.runState Proxy
40
49
50+-- | See 'Control.Monad.Ether.State.Lazy.evalStateT'.
41evalStateT :: Monad m => StateT s m a -> s -> m a
51evalStateT :: Monad m => StateT s m a -> s -> m a
42evalStateT = Explicit.evalStateT Proxy
52evalStateT = Explicit.evalStateT Proxy
43
53
54+-- | See 'Control.Monad.Ether.State.Lazy.evalState'.
44evalState :: State s a -> s -> a
55evalState :: State s a -> s -> a
45evalState = Explicit.evalState Proxy
56evalState = Explicit.evalState Proxy
46
57
58+-- | See 'Control.Monad.Ether.State.Lazy.execStateT'.
47execStateT :: Monad m => StateT s m a -> s -> m s
59execStateT :: Monad m => StateT s m a -> s -> m s
48execStateT = Explicit.execStateT Proxy
60execStateT = Explicit.execStateT Proxy
49
61
62+-- | See 'Control.Monad.Ether.State.Lazy.execState'.
50execState :: State s a -> s -> s
63execState :: State s a -> s -> s
51execState = Explicit.execState Proxy
64execState = Explicit.execState Proxy
52
65
66+-- | See 'Control.Monad.Ether.State.Lazy.mapStateT'.
53mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
67mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
54mapStateT = Explicit.mapStateT Proxy
68mapStateT = Explicit.mapStateT Proxy
55
69
70+-- | See 'Control.Monad.Ether.State.Lazy.MonadState'.
56type MonadState s = Explicit.MonadState s s
71type MonadState s = Explicit.MonadState s s
57
72
73+-- | See 'Control.Monad.Ether.State.Lazy.get'.
58get :: forall m s . MonadState s m => m s
74get :: forall m s . MonadState s m => m s
59get = Explicit.get (Proxy :: Proxy s)
75get = Explicit.get (Proxy :: Proxy s)
60
76
77+-- | See 'Control.Monad.Ether.State.Lazy.gets'.
61gets :: forall m s a . MonadState s m => (s -> a) -> m a
78gets :: forall m s a . MonadState s m => (s -> a) -> m a
62gets = Explicit.gets (Proxy :: Proxy s)
79gets = Explicit.gets (Proxy :: Proxy s)
63
80
81+-- | See 'Control.Monad.Ether.State.Lazy.put'.
64put :: forall m s . MonadState s m => s -> m ()
82put :: forall m s . MonadState s m => s -> m ()
65put = Explicit.put (Proxy :: Proxy s)
83put = Explicit.put (Proxy :: Proxy s)
66
84
85+-- | See 'Control.Monad.Ether.State.Lazy.state'.
67state :: forall m s a . MonadState s m => (s -> (a, s)) -> m a
86state :: forall m s a . MonadState s m => (s -> (a, s)) -> m a
68state = Explicit.state (Proxy :: Proxy s)
87state = Explicit.state (Proxy :: Proxy s)
69
88
89+-- | See 'Control.Monad.Ether.State.Lazy.modify'.
70modify :: forall m s . MonadState s m => (s -> s) -> m ()
90modify :: forall m s . MonadState s m => (s -> s) -> m ()
71modify = Explicit.modify (Proxy :: Proxy s)
91modify = Explicit.modify (Proxy :: Proxy s)
src/Control/Monad/Ether/Implicit/State/Strict.hs+20
@@ -1,5 +1,8 @@
1{-# LANGUAGE ConstraintKinds #-}
1{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE ScopedTypeVariables #-}
2{-# LANGUAGE ScopedTypeVariables #-}
3+
4+-- | See "Control.Monad.Ether.State.Strict".
5+
3module Control.Monad.Ether.Implicit.State.Strict
6module Control.Monad.Ether.Implicit.State.Strict
4 (
7 (
5 -- * MonadState class
8 -- * MonadState class
@@ -26,46 +29,63 @@ module Control.Monad.Ether.Implicit.State.Strict
26import Data.Proxy
29import Data.Proxy
27import qualified Control.Monad.Ether.State.Strict as Explicit
30import qualified Control.Monad.Ether.State.Strict as Explicit
28
31
32+-- | See 'Control.Monad.Ether.State.Strict.StateT'.
29type StateT s = Explicit.StateT s s
33type StateT s = Explicit.StateT s s
34+
35+-- | See 'Control.Monad.Ether.State.Strict.State'.
30type State s = Explicit.State s s
36type State s = Explicit.State s s
31
37
38+-- | See 'Control.Monad.Ether.State.Strict.stateT'.
32stateT :: (s -> m (a, s)) -> StateT s m a
39stateT :: (s -> m (a, s)) -> StateT s m a
33stateT = Explicit.stateT Proxy
40stateT = Explicit.stateT Proxy
34
41
42+-- | See 'Control.Monad.Ether.State.Strict.runStateT'.
35runStateT :: StateT s m a -> s -> m (a, s)
43runStateT :: StateT s m a -> s -> m (a, s)
36runStateT = Explicit.runStateT Proxy
44runStateT = Explicit.runStateT Proxy
37
45
46+-- | See 'Control.Monad.Ether.State.Strict.runState'.
38runState :: State s a -> s -> (a, s)
47runState :: State s a -> s -> (a, s)
39runState = Explicit.runState Proxy
48runState = Explicit.runState Proxy
40
49
50+-- | See 'Control.Monad.Ether.State.Strict.evalStateT'.
41evalStateT :: Monad m => StateT s m a -> s -> m a
51evalStateT :: Monad m => StateT s m a -> s -> m a
42evalStateT = Explicit.evalStateT Proxy
52evalStateT = Explicit.evalStateT Proxy
43
53
54+-- | See 'Control.Monad.Ether.State.Strict.evalState'.
44evalState :: State s a -> s -> a
55evalState :: State s a -> s -> a
45evalState = Explicit.evalState Proxy
56evalState = Explicit.evalState Proxy
46
57
58+-- | See 'Control.Monad.Ether.State.Strict.execStateT'.
47execStateT :: Monad m => StateT s m a -> s -> m s
59execStateT :: Monad m => StateT s m a -> s -> m s
48execStateT = Explicit.execStateT Proxy
60execStateT = Explicit.execStateT Proxy
49
61
62+-- | See 'Control.Monad.Ether.State.Strict.execState'.
50execState :: State s a -> s -> s
63execState :: State s a -> s -> s
51execState = Explicit.execState Proxy
64execState = Explicit.execState Proxy
52
65
66+-- | See 'Control.Monad.Ether.State.Strict.mapStateT'.
53mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
67mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
54mapStateT = Explicit.mapStateT Proxy
68mapStateT = Explicit.mapStateT Proxy
55
69
70+-- | See 'Control.Monad.Ether.State.Strict.MonadState'.
56type MonadState s = Explicit.MonadState s s
71type MonadState s = Explicit.MonadState s s
57
72
73+-- | See 'Control.Monad.Ether.State.Strict.get'.
58get :: forall m s . MonadState s m => m s
74get :: forall m s . MonadState s m => m s
59get = Explicit.get (Proxy :: Proxy s)
75get = Explicit.get (Proxy :: Proxy s)
60
76
77+-- | See 'Control.Monad.Ether.State.Strict.gets'.
61gets :: forall m s a . MonadState s m => (s -> a) -> m a
78gets :: forall m s a . MonadState s m => (s -> a) -> m a
62gets = Explicit.gets (Proxy :: Proxy s)
79gets = Explicit.gets (Proxy :: Proxy s)
63
80
81+-- | See 'Control.Monad.Ether.State.Strict.put'.
64put :: forall m s . MonadState s m => s -> m ()
82put :: forall m s . MonadState s m => s -> m ()
65put = Explicit.put (Proxy :: Proxy s)
83put = Explicit.put (Proxy :: Proxy s)
66
84
85+-- | See 'Control.Monad.Ether.State.Strict.state'.
67state :: forall m s a . MonadState s m => (s -> (a, s)) -> m a
86state :: forall m s a . MonadState s m => (s -> (a, s)) -> m a
68state = Explicit.state (Proxy :: Proxy s)
87state = Explicit.state (Proxy :: Proxy s)
69
88
89+-- | See 'Control.Monad.Ether.State.Strict.modify'.
70modify :: forall m s . MonadState s m => (s -> s) -> m ()
90modify :: forall m s . MonadState s m => (s -> s) -> m ()
71modify = Explicit.modify (Proxy :: Proxy s)
91modify = Explicit.modify (Proxy :: Proxy s)
src/Control/Monad/Ether/Implicit/Writer.hs+17
@@ -1,5 +1,8 @@
1{-# LANGUAGE ConstraintKinds #-}
1{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE ScopedTypeVariables #-}
2{-# LANGUAGE ScopedTypeVariables #-}
3+
4+-- | See "Control.Monad.Ether.Writer".
5+
3module Control.Monad.Ether.Implicit.Writer
6module Control.Monad.Ether.Implicit.Writer
4 (
7 (
5 -- * MonadWriter class
8 -- * MonadWriter class
@@ -24,41 +27,55 @@ module Control.Monad.Ether.Implicit.Writer
24import Data.Proxy
27import Data.Proxy
25import qualified Control.Monad.Ether.Writer as Explicit
28import qualified Control.Monad.Ether.Writer as Explicit
26
29
30+-- | See 'Control.Monad.Ether.Writer.MonadWriter'.
27type MonadWriter w = Explicit.MonadWriter w w
31type MonadWriter w = Explicit.MonadWriter w w
28
32
33+-- | See 'Control.Monad.Ether.Writer.writer'.
29writer :: forall m w a . MonadWriter w m => (a, w) -> m a
34writer :: forall m w a . MonadWriter w m => (a, w) -> m a
30writer = Explicit.writer (Proxy :: Proxy w)
35writer = Explicit.writer (Proxy :: Proxy w)
31
36
37+-- | See 'Control.Monad.Ether.Writer.tell'.
32tell :: forall m w . MonadWriter w m => w -> m ()
38tell :: forall m w . MonadWriter w m => w -> m ()
33tell = Explicit.tell (Proxy :: Proxy w)
39tell = Explicit.tell (Proxy :: Proxy w)
34
40
41+-- | See 'Control.Monad.Ether.Writer.listen'.
35listen :: forall m w a . MonadWriter w m => m a -> m (a, w)
42listen :: forall m w a . MonadWriter w m => m a -> m (a, w)
36listen = Explicit.listen (Proxy :: Proxy w)
43listen = Explicit.listen (Proxy :: Proxy w)
37
44
45+-- | See 'Control.Monad.Ether.Writer.pass'.
38pass :: forall m w a . MonadWriter w m => m (a, w -> w) -> m a
46pass :: forall m w a . MonadWriter w m => m (a, w -> w) -> m a
39pass = Explicit.pass (Proxy :: Proxy w)
47pass = Explicit.pass (Proxy :: Proxy w)
40
48
49+-- | See 'Control.Monad.Ether.Writer.listens'.
41listens :: forall m w a b . MonadWriter w m => (w -> b) -> m a -> m (a, b)
50listens :: forall m w a b . MonadWriter w m => (w -> b) -> m a -> m (a, b)
42listens = Explicit.listens (Proxy :: Proxy w)
51listens = Explicit.listens (Proxy :: Proxy w)
43
52
53+-- | See 'Control.Monad.Ether.Writer.censor'.
44censor :: forall m w a . MonadWriter w m => (w -> w) -> m a -> m a
54censor :: forall m w a . MonadWriter w m => (w -> w) -> m a -> m a
45censor = Explicit.censor (Proxy :: Proxy w)
55censor = Explicit.censor (Proxy :: Proxy w)
46
56
57+-- | See 'Control.Monad.Ether.Writer.Writer'.
47type Writer w = Explicit.Writer w w
58type Writer w = Explicit.Writer w w
48
59
60+-- | See 'Control.Monad.Ether.Writer.runWriter'.
49runWriter :: Writer w a -> (a, w)
61runWriter :: Writer w a -> (a, w)
50runWriter = Explicit.runWriter Proxy
62runWriter = Explicit.runWriter Proxy
51
63
64+-- | See 'Control.Monad.Ether.Writer.execWriter'.
52execWriter :: Writer w a -> w
65execWriter :: Writer w a -> w
53execWriter = Explicit.execWriter Proxy
66execWriter = Explicit.execWriter Proxy
54
67
68+-- | See 'Control.Monad.Ether.Writer.WriterT'.
55type WriterT w = Explicit.WriterT w w
69type WriterT w = Explicit.WriterT w w
56
70
71+-- | See 'Control.Monad.Ether.Writer.writerT'.
57writerT :: m (a, w) -> WriterT w m a
72writerT :: m (a, w) -> WriterT w m a
58writerT = Explicit.writerT Proxy
73writerT = Explicit.writerT Proxy
59
74
75+-- | See 'Control.Monad.Ether.Writer.runWriterT'.
60runWriterT :: WriterT w m a -> m (a, w)
76runWriterT :: WriterT w m a -> m (a, w)
61runWriterT = Explicit.runWriterT Proxy
77runWriterT = Explicit.runWriterT Proxy
62
78
79+-- | See 'Control.Monad.Ether.Writer.execWriterT'.
63execWriterT :: Monad m => WriterT w m a -> m w
80execWriterT :: Monad m => WriterT w m a -> m w
64execWriterT = Explicit.execWriterT Proxy
81execWriterT = Explicit.execWriterT Proxy
src/Control/Monad/Ether/Reader.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.Reader".
3+
1module Control.Monad.Ether.Reader
4module Control.Monad.Ether.Reader
2 (
5 (
3 -- * MonadReader class
6 -- * MonadReader class
src/Control/Monad/Ether/Reader/Class.hs+4
@@ -10,6 +10,9 @@
10{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE RankNTypes #-}
11{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
13+
14+-- | See "Control.Monad.Reader.Class".
15+
13module Control.Monad.Ether.Reader.Class
16module Control.Monad.Ether.Reader.Class
14 ( MonadReader(..)
17 ( MonadReader(..)
15 , asks
18 , asks
@@ -37,6 +40,7 @@ import qualified Control.Monad.Trans.State.Strict as Trans.Strict (StateT , m
37import qualified Control.Monad.Trans.Writer.Lazy as Trans.Lazy (WriterT , mapWriterT)
40import qualified Control.Monad.Trans.Writer.Lazy as Trans.Lazy (WriterT , mapWriterT)
38import qualified Control.Monad.Trans.Writer.Strict as Trans.Strict (WriterT , mapWriterT)
41import qualified Control.Monad.Trans.Writer.Strict as Trans.Strict (WriterT , mapWriterT)
39
42
43+-- | See 'Control.Monad.Reader.MonadReader'.
40class Monad m => MonadReader tag r m | m tag -> r where
44class Monad m => MonadReader tag r m | m tag -> r where
41
45
42 {-# MINIMAL (ask | reader), local #-}
46 {-# MINIMAL (ask | reader), local #-}
src/Control/Monad/Ether/State.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.State".
3+
1module Control.Monad.Ether.State
4module Control.Monad.Ether.State
2 ( module Control.Monad.Ether.State.Lazy
5 ( module Control.Monad.Ether.State.Lazy
3 ) where
6 ) where
src/Control/Monad/Ether/State/Class.hs+4
@@ -10,6 +10,9 @@
10{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE RankNTypes #-}
11{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
13+
14+-- | See "Control.Monad.State.Class".
15+
13module Control.Monad.Ether.State.Class
16module Control.Monad.Ether.State.Class
14 ( MonadState(..)
17 ( MonadState(..)
15 , modify
18 , modify
@@ -36,6 +39,7 @@ import qualified Control.Monad.Trans.State.Strict as Trans.Strict (StateT)
36import qualified Control.Monad.Trans.Writer.Lazy as Trans.Lazy (WriterT)
39import qualified Control.Monad.Trans.Writer.Lazy as Trans.Lazy (WriterT)
37import qualified Control.Monad.Trans.Writer.Strict as Trans.Strict (WriterT)
40import qualified Control.Monad.Trans.Writer.Strict as Trans.Strict (WriterT)
38
41
42+-- | See 'Control.Monad.State.MonadState'.
39class Monad m => MonadState tag s m | m tag -> s where
43class Monad m => MonadState tag s m | m tag -> s where
40
44
41 {-# MINIMAL state | get, put #-}
45 {-# MINIMAL state | get, put #-}
src/Control/Monad/Ether/State/Lazy.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.State.Lazy".
3+
1module Control.Monad.Ether.State.Lazy
4module Control.Monad.Ether.State.Lazy
2 (
5 (
3 -- * MonadState class
6 -- * MonadState class
src/Control/Monad/Ether/State/Strict.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.State.Strict".
3+
1module Control.Monad.Ether.State.Strict
4module Control.Monad.Ether.State.Strict
2 (
5 (
3 -- * MonadState class
6 -- * MonadState class
src/Control/Monad/Ether/Writer.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.Writer".
3+
1module Control.Monad.Ether.Writer
4module Control.Monad.Ether.Writer
2 (
5 (
3 -- * MonadWriter class
6 -- * MonadWriter class
src/Control/Monad/Ether/Writer/Class.hs+7
@@ -10,6 +10,9 @@
10{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE RankNTypes #-}
11{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
13+
14+-- | See "Control.Monad.Writer.Class".
15+
13module Control.Monad.Ether.Writer.Class
16module Control.Monad.Ether.Writer.Class
14 ( MonadWriter(..)
17 ( MonadWriter(..)
15 , listens
18 , listens
@@ -36,6 +39,7 @@ import qualified Control.Monad.Trans.State.Lazy as Trans.S.Lazy
36import qualified Control.Monad.Trans.State.Strict as Trans.S.Strict
39import qualified Control.Monad.Trans.State.Strict as Trans.S.Strict
37import qualified Control.Monad.Trans.Writer.Lazy as Trans.W.Lazy
40import qualified Control.Monad.Trans.Writer.Lazy as Trans.W.Lazy
38
41
42+-- | See 'Control.Monad.Writer.MonadWriter'.
39class (Monoid w, Monad m) => MonadWriter tag w m | m tag -> w where
43class (Monoid w, Monad m) => MonadWriter tag w m | m tag -> w where
40
44
41 {-# MINIMAL (writer | tell), listen, pass #-}
45 {-# MINIMAL (writer | tell), listen, pass #-}
@@ -58,11 +62,14 @@ class (Monoid w, Monad m) => MonadWriter tag w m | m tag -> w where
58 -- and return the value, applying the function to the accumulator.
62 -- and return the value, applying the function to the accumulator.
59 pass :: proxy tag -> m (a, w -> w) -> m a
63 pass :: proxy tag -> m (a, w -> w) -> m a
60
64
65+-- | Execute an action and add the result of applying the given function to
66+-- its accumulator to the value of the computation.
61listens :: MonadWriter tag w m => proxy tag -> (w -> b) -> m a -> m (a, b)
67listens :: MonadWriter tag w m => proxy tag -> (w -> b) -> m a -> m (a, b)
62listens t f m = do
68listens t f m = do
63 ~(a, w) <- listen t m
69 ~(a, w) <- listen t m
64 return (a, f w)
70 return (a, f w)
65
71
72+-- | Execute an action and apply a function to its accumulator.
66censor :: MonadWriter tag w m => proxy tag -> (w -> w) -> m a -> m a
73censor :: MonadWriter tag w m => proxy tag -> (w -> w) -> m a -> m a
67censor t f m = pass t $ do
74censor t f m = pass t $ do
68 a <- m
75 a <- m
src/Control/Monad/Trans/Ether/Except.hs+5
@@ -7,6 +7,9 @@
7{-# LANGUAGE DataKinds #-}
7{-# LANGUAGE DataKinds #-}
8{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
10+
11+-- | See "Control.Monad.Trans.Except".
12+
10module Control.Monad.Trans.Ether.Except
13module Control.Monad.Trans.Ether.Except
11 (
14 (
12 -- * The Except monad
15 -- * The Except monad
@@ -105,9 +108,11 @@ mapExceptT
105 -> ExceptT tag e' n b
108 -> ExceptT tag e' n b
106mapExceptT t f m = tagged t $ Trans.mapExceptT f (coerce m)
109mapExceptT t f m = tagged t $ Trans.mapExceptT f (coerce m)
107
110
111+-- | Is used within a monadic computation to begin exception processing.
108throw :: Monad m => proxy tag -> e -> ExceptT tag e m a
112throw :: Monad m => proxy tag -> e -> ExceptT tag e m a
109throw t = tagged t . Trans.throwE
113throw t = tagged t . Trans.throwE
110
114
115+-- | A handler function to handle previous exceptions and return to normal execution.
111catch :: Monad m => proxy tag -> ExceptT tag e m a -> (e -> ExceptT tag e m a) -> ExceptT tag e m a
116catch :: Monad m => proxy tag -> ExceptT tag e m a -> (e -> ExceptT tag e m a) -> ExceptT tag e m a
112catch t m h = tagged t $ Trans.catchE (coerce m) (coerce . h)
117catch t m h = tagged t $ Trans.catchE (coerce m) (coerce . h)
113
118
src/Control/Monad/Trans/Ether/Reader.hs+3
@@ -7,6 +7,9 @@
7{-# LANGUAGE DataKinds #-}
7{-# LANGUAGE DataKinds #-}
8{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
10+
11+-- | See "Control.Monad.Trans.Reader".
12+
10module Control.Monad.Trans.Ether.Reader
13module Control.Monad.Trans.Ether.Reader
11 (
14 (
12 -- * The Reader monad
15 -- * The Reader monad
src/Control/Monad/Trans/Ether/State.hs+3
@@ -1,3 +1,6 @@
1+
2+-- | See "Control.Monad.Trans.State".
3+
1module Control.Monad.Trans.Ether.State
4module Control.Monad.Trans.Ether.State
2 ( module Control.Monad.Trans.Ether.State.Lazy
5 ( module Control.Monad.Trans.Ether.State.Lazy
3 ) where
6 ) where
src/Control/Monad/Trans/Ether/State/Lazy.hs+3
@@ -7,6 +7,9 @@
7{-# LANGUAGE DataKinds #-}
7{-# LANGUAGE DataKinds #-}
8{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
10+
11+-- | See "Control.Monad.Trans.State.Lazy".
12+
10module Control.Monad.Trans.Ether.State.Lazy
13module Control.Monad.Trans.Ether.State.Lazy
11 (
14 (
12 -- * The State monad
15 -- * The State monad
src/Control/Monad/Trans/Ether/State/Strict.hs+3
@@ -7,6 +7,9 @@
7{-# LANGUAGE DataKinds #-}
7{-# LANGUAGE DataKinds #-}
8{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
10+
11+-- | See "Control.Monad.Trans.State.Strict".
12+
10module Control.Monad.Trans.Ether.State.Strict
13module Control.Monad.Trans.Ether.State.Strict
11 (
14 (
12 -- * The State monad
15 -- * The State monad
src/Control/Monad/Trans/Ether/Writer.hs+6
@@ -7,6 +7,9 @@
7{-# LANGUAGE DataKinds #-}
7{-# LANGUAGE DataKinds #-}
8{-# LANGUAGE TypeOperators #-}
8{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9{-# LANGUAGE GeneralizedNewtypeDeriving #-}
10+
11+-- | See "Control.Monad.Trans.Writer".
12+
10module Control.Monad.Trans.Ether.Writer
13module Control.Monad.Trans.Ether.Writer
11 (
14 (
12 -- * The Writer monad
15 -- * The Writer monad
@@ -118,9 +121,12 @@ mapWriterT t f m = tagged t $ Trans.mapWriterT f (coerce m)
118tell :: Monad m => proxy tag -> w -> WriterT tag w m ()
121tell :: Monad m => proxy tag -> w -> WriterT tag w m ()
119tell t w = writer t ((), w)
122tell t w = writer t ((), w)
120
123
124+-- | Executes an action and adds its accumulator to the value of the computation.
121listen :: (Monoid w, Monad m) => proxy tag -> WriterT tag w m a -> WriterT tag w m (a, w)
125listen :: (Monoid w, Monad m) => proxy tag -> WriterT tag w m a -> WriterT tag w m (a, w)
122listen t m = tagged t $ Trans.listen (coerce m)
126listen t m = tagged t $ Trans.listen (coerce m)
123
127
128+-- | Executes an action which returns a value and a function, and returns the
129+-- value, applying the function to the accumulator.
124pass :: (Monoid w, Monad m) => proxy tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
130pass :: (Monoid w, Monad m) => proxy tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
125pass t m = tagged t $ Trans.pass (coerce m)
131pass t m = tagged t $ Trans.pass (coerce m)
126
132
test/Regression.hs+7−10
@@ -153,22 +153,19 @@ factorial' a = factorial (a :: Int)
153
153
154data DivideByZero = DivideByZero
154data DivideByZero = DivideByZero
155 deriving (Show)
155 deriving (Show)
156−data NegativeLog = NegativeLog
156+data NegativeLog a = NegativeLog a
157 deriving (Show)
157 deriving (Show)
158
158
159exceptCore
159exceptCore
160 :: ( Floating a, Ord a
160 :: ( Floating a, Ord a
161 , I.MonadExcept DivideByZero m
161 , I.MonadExcept DivideByZero m
162− , I.MonadExcept NegativeLog m
162+ , I.MonadExcept (NegativeLog a) m
163 ) => a -> a -> m a
163 ) => a -> a -> m a
164exceptCore a b = do
164exceptCore a b = do
165− if b == 0
166− then I.throw DivideByZero
165+ T.when (b == 0) (I.throw DivideByZero)
167− else
168− let d = a /b
166+ let d = a /b
169− in if d < 0
170− then I.throw NegativeLog
167+ T.when (d < 0) (I.throw (NegativeLog d))
171− else return $ log (a / b)
168+ return (log d)
172
169
173try0 :: m a -> m a
170try0 :: m a -> m a
174try0 = $(try 0)
171try0 = $(try 0)
@@ -186,7 +183,7 @@ exceptCore' :: Double -> Double -> String
186exceptCore' a b = runIdentity $ do
183exceptCore' a b = runIdentity $ do
187 $(try 2)
184 $(try 2)
188 (show <$> exceptCore a b)
185 (show <$> exceptCore a b)
189− (\NegativeLog -> "nl")
186+ (\(NegativeLog (x::Double)) -> "nl: " ++ show x)
190 (\DivideByZero -> "dz")
187 (\DivideByZero -> "dz")
191
188
192summatorCore
189summatorCore