GHC Core questions
Isaac Dupree
isaacdupree at charter.net
Sun Jul 1 12:17:35 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Neil Mitchell wrote:
> --- GHC -> Yhc convertor ---
> -- note: uses the old interface to generate Core, since that matches
> the snapshot on
> -- the machine I developed it
> --
> -- some functions are branches are incomplete, purely because I have not
> -- encountered them yet
>
> import GHC
> import Outputable
> import CoreSyn hiding (CoreExpr)
> import Var
> import Literal
>
> import Yhc.Core
...
> transExpr :: Expr Var -> CoreExpr
> transExpr (Note _ x) = transExpr x
> transExpr (Var x) = CoreVar (show x)
> transExpr (App a Type{}) = transExpr a
> transExpr (App a b) = CoreApp (transExpr a) [transExpr b]
Ugh. qualifying with Ghc versus Yhc for the different Cores would make
that much nicer. sorry, it bothered me too much
Isaac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGh9OeHgcxvIWYTTURArzjAJ4n5s29SecV71zti6FxIA2muUy5MACgh1+2
ybj9ehsQhgjSUu6DmOZNsCA=
=HTQL
-----END PGP SIGNATURE-----
More information about the Cvs-ghc
mailing list