mirror of
https://github.com/polysemy-research/polysemy.git
synced 2024-12-12 02:13:15 +03:00
whoops
This commit is contained in:
parent
05fea09eb0
commit
eba22cc6ac
@ -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'
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user