import { type State } from "https://deno.land/x/fun@v2.0.0/examples/freer.ts";
First, defint state for testing.
newtype State s a = State{unState :: s -> (a,s)}
get :: State s s
get = State $ \s -> (s,s)
put :: s -> State s ()
put s = State $ \_ -> ((),s)
runState :: State s a -> s -> (a,s)
runState = unState