git.iko.soy/rowtype-yoga/purescript-backend-optimizer
on main help sign in
19 lines 462 B history raw
1module Snapshot.UncurriedSTFns02 where
3import Prelude
5import Control.Monad.ST.Internal (ST, run)
6import Control.Monad.ST.Uncurried (STFn1, mkSTFn1, runSTFn1)
7import Effect (Effect)
8import Effect.Class.Console (logShow)
10test1 :: forall r. ST r Int
11test1 = runSTFn1 (mkSTFn1 \m -> pure m) 12
13test2 :: Effect Int -> Effect Unit
14test2 random = do
15 let
16 f :: forall r. STFn1 Int r Int
17 f = mkSTFn1 \n -> pure n
18 n <- random
19 logShow (run (runSTFn1 f n))