From eba22cc6acd1e4b83f770d53e1f7fad5917845a1 Mon Sep 17 00:00:00 2001 From: Sandy Maguire Date: Thu, 21 Feb 2019 18:55:12 -0500 Subject: [PATCH] whoops --- src/Lib.hs | 2 +- src/Wtf.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lib.hs b/src/Lib.hs index 722c346..58f45ca 100644 --- a/src/Lib.hs +++ b/src/Lib.hs @@ -49,7 +49,7 @@ runTeletype = interpret $ \case -- main = runM (runState "fuck" foom) >>= print -runState :: s -> Eff (State s ': r) a -> Eff r a +runState :: s -> Eff (State s ': r) a -> Eff r (a, s) runState = stateful $ \case Get -> S.get Put s' -> S.put s' diff --git a/src/Wtf.hs b/src/Wtf.hs index 110a5a6..f388447 100644 --- a/src/Wtf.hs +++ b/src/Wtf.hs @@ -7,7 +7,7 @@ import Eff.Type import Data.Functor.Identity countDown :: Int -> Int -countDown start = run $ runState "hello" $ runState start go +countDown start = fst $ fst $ run $ runState "hello" $ runState start go where go :: Eff '[State Int, State String, Identity] Int go = get >>= (\n -> if n <= 0 then (pure n) else (put (n-1)) >> go)