
Robin Milner and J. Roger Hindley
An implementation of the Hindley-Milner type system (wikipedia) in a simple Scheme/Lisp like language.
Simon Peyton Jones how GHC type inference engine actually works Watch Here
A Practical Type Checker for Scheme by Christian Lindig Read Here
The Design and Implementation of Typed Scheme by Sam Tobin-Hochstadt and Mathhias Felleisen Read Here
The Hindley-Milner Type System Watch Here
# ghc -o dist/hm --make src/hs.hs
# ./dist/hm ...# cabal build
# ./dist-newstyle/build/x86_64-osx/ghc-8.6.5/hm-0.1.0.0/x/hm/build/hm/hmMost Features of the Type System and Operators come from R5RS (https://schemers.org/Documents/Standards/R5RS/HTML/) of Scheme, the standard for Scheme like Languages.
- An
Atom, which stores a String naming the atom - A
List, which stores a list of otherLispVals(Haskell lists are denoted by brackets); also called aproperlist - A
DottedList, representing theSchemeform(a b . c); also called animproperlist. This stores a list of all elements but the last, and then stores the last element as another field - A
Number, containing a Haskell Integer - A
String, containing a Haskell String - A
Bool, containing a Haskell boolean value
+plus/addition operator-minus/subtraction operator*times/multiplication operator/divide operatormodmodulus operatorquotientquotient operatorremainderremainder operator / returns the remainder
./hm
hm>>> (define (f x y) (+ x y))
(lambda ("x" "y") ...)
hm>>> (f 1 2)
3










