git.iko.soy/effects-benchmarks
on master help sign in
7 lines 202 B history raw
1module Poly.Stateful where
3import Polysemy
4import Polysemy.State
6countDownPut :: Member (State Int) r => Sem r Int
7countDownPut = get >>= (\n -> if n < 0 then pure n else put (n - 1) *> countDownPut)