mirror of
https://github.com/polysemy-research/polysemy.git
synced 2024-12-12 13:06:18 +03:00
not sure where hello came from
This commit is contained in:
parent
6004911550
commit
0b0e9c61f0
@ -7,9 +7,9 @@ import Eff.Type
|
|||||||
import Data.Functor.Identity
|
import Data.Functor.Identity
|
||||||
|
|
||||||
countDown :: Int -> Int
|
countDown :: Int -> Int
|
||||||
countDown start = fst $ fst $ run $ runState "hello" $ runState start go
|
countDown start = fst $ run $ runState start go
|
||||||
where
|
where
|
||||||
go :: Eff '[State Int, State String, Identity] Int
|
go :: Eff '[State Int, Identity] Int
|
||||||
go = get >>= (\n -> if n <= 0 then (pure n) else (put (n-1)) >> go)
|
go = get >>= (\n -> if n <= 0 then (pure n) else (put (n-1)) >> go)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user