diff --git a/bench/Core.hs b/bench/Core.hs index a599734..7861f40 100644 --- a/bench/Core.hs +++ b/bench/Core.hs @@ -44,10 +44,10 @@ import Control.Monad.Freer.StateRW (ask, tell, runStateR) -------------------------------------------------------------------------------- oneGet :: Int -> (Int, Int) -oneGet n = run (runState get n) +oneGet = run . runState get oneGetMTL :: Int -> (Int, Int) -oneGetMTL n = MTL.runState MTL.get n +oneGetMTL = MTL.runState MTL.get countDown :: Int -> (Int,Int) countDown start = run (runState go start) diff --git a/src/Control/Monad/Freer/Writer.hs b/src/Control/Monad/Freer/Writer.hs index 1860f19..1c73987 100644 --- a/src/Control/Monad/Freer/Writer.hs +++ b/src/Control/Monad/Freer/Writer.hs @@ -25,6 +25,7 @@ module Control.Monad.Freer.Writer where import Control.Applicative (pure) +import Control.Arrow (second) import Data.Function (($)) import Data.Functor ((<$>)) import Data.Monoid (Monoid, (<>), mempty) @@ -43,4 +44,4 @@ tell w = send $ Writer w -- | Simple handler for 'Writer' effects. runWriter :: Monoid w => Eff (Writer w ': effs) a -> Eff effs (a, w) runWriter = handleRelay (\a -> pure (a, mempty)) $ \(Writer w) k -> - (\(a, l) -> (a, w <> l)) <$> k () + second (w <>) <$> k ()