Created
May 13, 2019 03:55
-
-
Save hrajchert/4432e0153b96072250a38f5d21cf5d3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new :: forall a r. a -> ST r (STRef r a) | |
read :: forall a r. STRef r a -> ST r a | |
write :: forall a r. a -> STRef r a -> ST r a | |
myDoExpr :: forall r. ST r Int | |
myDoExpr = do | |
-- ref :: STRef r Int | |
ref <- Ref.new 0 | |
-- val :: Int | |
val <- Ref.read ref | |
-- ST r Int | |
Ref.write (val + 1) ref |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment