Haskell CoreSyn library -- how does one refer to built-in IO types?

Viewed 68

I am trying to see how the following Haskell code gets translated to the data types defined in the Coresyn library.

module Main where 

f :: Double -> IO () 
f = putStrLn . show

main :: IO ()
main = f 3

I can obtain the core code made human readable by -ddump-simpl, but what I don't understand is how one would translate this into the data structure for Core in the Coresyn library. In particular, I don't know how to translate the "IO ()" bit. My guess is that it involves first building something like TyCon "IO" unitTy but what is one supposed to put for IO. I also don't know how to call a built-in function like putStrLn using the constructors in Coresyn.

How does one build the built-in IO primitives "IO a" and "putStrLn" using the Coresyn library?

0 Answers
Related