mirror of
https://github.com/lexi-lambda/freer-simple.git
synced 2024-12-24 14:43:57 +03:00
Fix HLint suggestions
This commit is contained in:
parent
d72412caac
commit
2affe8b612
@ -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)
|
||||
|
@ -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 ()
|
||||
|
Loading…
Reference in New Issue
Block a user