Last active
August 29, 2015 14:00
-
-
Save munro/11383147 to your computer and use it in GitHub Desktop.
This file contains 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
-- How do I force evaluation when working with monadic values? :( | |
type HeapPtr = Integer | |
type VMVariable = String | |
__fn_0 :: [VMVariable] -> VMVariable | |
createFunction :: ([VMVariable] -> VMVariable) -> VMState VMVariable | |
setProp :: HeapPtr -> VMVariable -> VMVariable -> VMState () | |
vmMain = do | |
-- works, forces evaluation... IRC says I have to do this >_< | |
myFn <- (createFunction __fn_0); | |
_ <- setProp __my_scope "A" myFn; | |
-- doesn't work, "A" function never appears on heap :( | |
_ <- (setProp __my_scope "A") <$> (createFunction __fn_0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment