mirror of
https://github.com/lexi-lambda/freer-simple.git
synced 2024-12-24 14:43:57 +03:00
HLint
This commit is contained in:
parent
c7170f2f89
commit
85614f823f
@ -19,4 +19,4 @@ runCapitalizeM :: Eff (Capitalize ': r) w -> Eff r w
|
|||||||
runCapitalizeM (Val x) = return x
|
runCapitalizeM (Val x) = return x
|
||||||
runCapitalizeM (E u q) = case decomp u of
|
runCapitalizeM (E u q) = case decomp u of
|
||||||
Right (Capitalize s) -> runCapitalizeM (qApp q (map toUpper s))
|
Right (Capitalize s) -> runCapitalizeM (qApp q (map toUpper s))
|
||||||
Left u' -> E u' (tsingleton (\s -> runCapitalizeM (qApp q s)))
|
Left u' -> E u' (tsingleton (runCapitalizeM . qApp q))
|
||||||
|
@ -65,9 +65,9 @@ runConsoleM :: Member IO r => Eff (Console ': r) w -> Eff r w
|
|||||||
runConsoleM (Val x) = return x
|
runConsoleM (Val x) = return x
|
||||||
runConsoleM (E u q) = case decomp u of
|
runConsoleM (E u q) = case decomp u of
|
||||||
Right (PutStrLn msg) -> send (putStrLn msg) >> runConsoleM (qApp q ())
|
Right (PutStrLn msg) -> send (putStrLn msg) >> runConsoleM (qApp q ())
|
||||||
Right GetLine -> send getLine >>= \s -> runConsoleM (qApp q s)
|
Right GetLine -> send getLine >>= runConsoleM . qApp q
|
||||||
Right ExitSuccess -> send exitSuccess
|
Right ExitSuccess -> send exitSuccess
|
||||||
Left u' -> E u' (tsingleton (\s -> runConsoleM (qApp q s)))
|
Left u' -> E u' (tsingleton (runConsoleM . qApp q))
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- Pure Interpreter for Deeper Stack --
|
-- Pure Interpreter for Deeper Stack --
|
||||||
@ -89,4 +89,4 @@ runConsolePureM inputs = f (inputs,[]) where
|
|||||||
x:s -> f (s,os) (qApp q x)
|
x:s -> f (s,os) (qApp q x)
|
||||||
[] -> error "Not enough lines"
|
[] -> error "Not enough lines"
|
||||||
Right ExitSuccess -> pure (Nothing, st)
|
Right ExitSuccess -> pure (Nothing, st)
|
||||||
Left u' -> E u' (tsingleton (\s -> f st (qApp q s)))
|
Left u' -> E u' (tsingleton (f st . qApp q))
|
||||||
|
Loading…
Reference in New Issue
Block a user