[Haskell-cafe] Type checking with Haskell
bjpop at csse.unimelb.edu.au
Thu Apr 12 09:13:51 EDT 2007
You may like to check out my mini-interpreter called (cheekily) baskell:
It has type inference, and it is pretty straightforward. I wrote it for
First, I pass over the AST and generate a set of typing constraints. They
are just equality constraints. Then I solve the constraints. Couldn't be
much simpler than that. Mind you, the input language is pretty minimal (no
type classes etcetera).
> -----Original Message-----
> From: haskell-cafe-bounces at haskell.org [mailto:haskell-cafe-
> bounces at haskell.org] On Behalf Of Joel Reymont
> Sent: 12 April 2007 13:04
> To: Haskell Cafe
> Subject: [Haskell-cafe] Type checking with Haskell
> The ghc/compiler/typecheck directory holds a rather large body of
> code and quick browsing through did not produce any insight.
> How do you implement type checking in haskell?
> Assume I have an Expr type with a constructor per type and functions
> can take lists of expressions. Do I create a function taking an Expr,
> pattern-matching on appropriate constructor and returning True on a
> match and False otherwise?
> Thanks, Joel
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe