[Haskell-cafe] Re: [Haskell] [Fwd: Re: Computer Language Shootout]

Neil Mitchell ndmitchell at gmail.com
Thu Jan 25 19:00:04 EST 2007


> > Yhc has intermediate code that is substantially more Haskell like, and
> > with the command:

> Wow, the core looks really cool! One look and you see it all. I would
> even rename the local variables to single letters like a,b,c because the
> cryptic numbers are quite hard to track. This is something coreHtml can
> do. Also, I'd add more color, like making punctuation marks grey, but
> that's a very personal taste.

Yhc.Core is a big library of "useful things to do with Yhc Core". One
of them is:

uniqueBoundVarsWith :: [String] -> CoreExpr -> CoreExpr

Which replaces the free variables with a list you pick. This means
that the transformation you want is a single line:

applyBodyCore (uniqueBoundVarsWith (map (:[]) ['a'..]))

That will transform a whole Core program, giving you the variables you
requested. That's one of the things I like about Yhc.Core, it is a
very nice library to use.



More information about the Haskell-Cafe mailing list