An Explanation of Type Inference for ML/Haskell
jozefg.bitbucket.org
jozefg.bitbucket.org
[1] http://stackoverflow.com/questions/23939168/is-c-sharp-type-...
[2] http://caml.inria.fr/pub/old_caml_site/caml-list/1507.html
[3] http://www.normalesup.org/~simonet/publis/simonet-aplas03.pd...
[2] is a paper with a modula-2 implementation. Written by Luca Cardelli, a type fellow, it really helped me to understand type inference.
[1] https://github.com/tomprimozic/type-systems. [2] http://lucacardelli.name/Papers/BasicTypechecking.pdf
I don't suppose you know of an equivalent written in Haskell, do you?
http://andrej.com/plzoo/html/miniml.html
you can almost translate that with an emacs macro. Except for the parsing stuff, which is some OCaml specific parser generator.
If I knew Haskell, I expect I could. However I am currently learning Haskell, which is why I'd be interested in a repository of example language implementations in Haskell.
> some OCaml specific parser generator
Which looks quite nice, and is evidently modelled on yacc/lex. People rave about Haskell's Parsec but TBH I'm finding it a bit unintuitive.
But the coolest thing about Parsec is that you can construct the parser at run-time, for instance calculating it after scanning a file for infix declarations. If you want custom infix in a yaccy grammar, you have to walk the AST afterwards to fix the application precedence.
I suppose you could have inferred (ha) I feel that way from this blog post though :)