Skip to content

Instantly share code, notes, and snippets.

@master-q
Created June 4, 2013 19:09
Show Gist options
  • Save master-q/5708605 to your computer and use it in GitHub Desktop.
Save master-q/5708605 to your computer and use it in GitHub Desktop.
AjhcさんdeRefStablePtrでIOを戻すと実行できない。。。
import Foreign.StablePtr
main :: IO ()
main = do
p <- newStablePtr $ print "hoge"
d <- deRefStablePtr p
d
@master-q
Copy link
Author

master-q commented Jun 4, 2013

$ ajhc Test.hs
ajhc Test.hs
ajhc 0.8.0.5 (b6d58e95e63be9848f267e9242dedff5e5f7b25b)
Finding Dependencies...
Using Ho Cache: '/home/kiwamu/.ajhc/cache'
Main [Test.hs]
Typechecking...
[1 of 1] Main (.............................................)
Compiling...
[1 of 1] Main <..................................................>
Collected Compilation...
-- TypeAnalyzeMethods
-- BoxifyProgram
-- Boxy WorkWrap
-- LambdaLift
Converting to Grin...
Updatable CAFS: 0
Constant CAFS: 0
Recursive CAFS: 0
ajhc: Grin.FromE.compile'.ce in function: theMain
can't grok expression: <fromBang_ x67685495∷IO ()> x62470114

@master-q
Copy link
Author

master-q commented Jun 4, 2013

$ ghc Test.hs
Linking Test ...
casper$ ./Test
"hoge"
$ echo orz
orz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment