on master help sign in
Fix determining arguments of Reader/Writer/RWS

Implementations should be determined by m only, not the state types

commit0b9a9f86db4d27709f316d5252e4b455ace825a7 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateThu 21 Jul 2016, 15:16 (10 years ago) parentd368fd4
3 files changed+3−3
libs/base/Control/Monad/RWS.idr+1−1 libs/base/Control/Monad/Reader.idr+1−1 libs/base/Control/Monad/Writer.idr+1−1
libs/base/Control/Monad/RWS.idr+1−1
@@ -8,7 +8,7 @@ import Control.Monad.Reader
88%access public export
99
1010||| A combination of the Reader, Writer, and State monads
11−interface (Monoid w, MonadReader r m, MonadWriter w m, MonadState s m) => MonadRWS r w s (m : Type -> Type) where {}
11+interface (Monoid w, MonadReader r m, MonadWriter w m, MonadState s m) => MonadRWS r w s (m : Type -> Type) | m where {}
1212
1313||| The transformer on which the RWS monad is based
1414record RWST (r : Type) (w : Type) (s : Type) (m : Type -> Type) (a : Type) where
libs/base/Control/Monad/Reader.idr+1−1
@@ -7,7 +7,7 @@ import Control.Monad.Trans
77%access public export
88
99||| A monad representing a computation that runs in an immutable context
10−interface Monad m => MonadReader r (m : Type -> Type) where
10+interface Monad m => MonadReader r (m : Type -> Type) | m where
1111 ||| Return the context
1212 ask : m r
1313 ||| Temprorarily modify the input and run an action in the new context
libs/base/Control/Monad/Writer.idr+1−1
@@ -7,7 +7,7 @@ import Control.Monad.Trans
77%access public export
88
99||| A monad representing a computation that produces a stream of output
10−interface (Monoid w, Monad m) => MonadWriter w (m : Type -> Type) where
10+interface (Monoid w, Monad m) => MonadWriter w (m : Type -> Type) | m where
1111 ||| tell w produces the output w
1212 tell : w -> m ()
1313 ||| Execute an action and add it's output to the value of the computation