diff --git a/libs/base/Control/Monad/RWS/CPS.idr b/libs/base/Control/Monad/RWS/CPS.idr index f97f80142..2e10a9958 100644 --- a/libs/base/Control/Monad/RWS/CPS.idr +++ b/libs/base/Control/Monad/RWS/CPS.idr @@ -90,7 +90,7 @@ execRWS m r s = let (_,s1,w) = runRWS m r s public export %inline mapRWS : (Monoid w, Semigroup w') => ((a, s, w) -> (b, s, w')) -> RWS r w s a -> RWS r w' s b -mapRWS f = mapRWST (Id . f . runIdentity) +mapRWS f = mapRWST \(Id p) => Id (f p) ||| `withRWS f m` executes action `m` with an initial environment ||| and state modified by applying `f`. diff --git a/libs/base/Control/Monad/State/State.idr b/libs/base/Control/Monad/State/State.idr index 438110412..816ef4c3b 100644 --- a/libs/base/Control/Monad/State/State.idr +++ b/libs/base/Control/Monad/State/State.idr @@ -59,7 +59,7 @@ execState s = fst . runState s ||| the given function. public export %inline mapState : ((s, a) -> (s, b)) -> State s a -> State s b -mapState f = mapStateT (Id . f . runIdentity) +mapState f = mapStateT \(Id p) => Id (f p) -------------------------------------------------------------------------------- -- Implementations diff --git a/libs/base/Control/Monad/Writer/CPS.idr b/libs/base/Control/Monad/Writer/CPS.idr index 9db0d477e..82e65dbb6 100644 --- a/libs/base/Control/Monad/Writer/CPS.idr +++ b/libs/base/Control/Monad/Writer/CPS.idr @@ -70,7 +70,7 @@ execWriter = runIdentity . execWriterT public export %inline mapWriter : (Monoid w, Semigroup w') => ((a, w) -> (b, w')) -> Writer w a -> Writer w' b -mapWriter f = mapWriterT (Id . f . runIdentity) +mapWriter f = mapWriterT \(Id p) => Id (f p) -------------------------------------------------------------------------------- -- Implementations