Fix HLint suggestions

This commit is contained in:
Tomas Janousek 2017-03-02 21:31:05 +01:00
parent d72412caac
commit 2affe8b612
2 changed files with 4 additions and 3 deletions

View File

@ -44,10 +44,10 @@ import Control.Monad.Freer.StateRW (ask, tell, runStateR)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
oneGet :: Int -> (Int, Int) oneGet :: Int -> (Int, Int)
oneGet n = run (runState get n) oneGet = run . runState get
oneGetMTL :: Int -> (Int, Int) oneGetMTL :: Int -> (Int, Int)
oneGetMTL n = MTL.runState MTL.get n oneGetMTL = MTL.runState MTL.get
countDown :: Int -> (Int,Int) countDown :: Int -> (Int,Int)
countDown start = run (runState go start) countDown start = run (runState go start)

View File

@ -25,6 +25,7 @@ module Control.Monad.Freer.Writer
where where
import Control.Applicative (pure) import Control.Applicative (pure)
import Control.Arrow (second)
import Data.Function (($)) import Data.Function (($))
import Data.Functor ((<$>)) import Data.Functor ((<$>))
import Data.Monoid (Monoid, (<>), mempty) import Data.Monoid (Monoid, (<>), mempty)
@ -43,4 +44,4 @@ tell w = send $ Writer w
-- | Simple handler for 'Writer' effects. -- | Simple handler for 'Writer' effects.
runWriter :: Monoid w => Eff (Writer w ': effs) a -> Eff effs (a, w) runWriter :: Monoid w => Eff (Writer w ': effs) a -> Eff effs (a, w)
runWriter = handleRelay (\a -> pure (a, mempty)) $ \(Writer w) k -> runWriter = handleRelay (\a -> pure (a, mempty)) $ \(Writer w) k ->
(\(a, l) -> (a, w <> l)) <$> k () second (w <>) <$> k ()