Parse defs and externs
authorLuke Lau <luke_lau@icloud.com>
Sat, 18 May 2019 16:54:06 +0000 (17:54 +0100)
committerLuke Lau <luke_lau@icloud.com>
Mon, 3 Jun 2019 14:44:14 +0000 (15:44 +0100)
commitdbe789123e171b6e467b44b17735a3b9e46a1627
tree4bbee8ace5f4cb7d9dfd299cdcbe85ecc3fd0705
parente7171a5ebd7d1089dbf8d5465edcd74375df02d6
Parse defs and externs

They both share a common prototype so we can split that out into a
separate definition. We also want to be able to parse top level
expressions, so we add constructor for that in AST.
Hopefully now you can see the beauty of monadic parsing:
Function <$> readPrec <*> readPrec
AST.hs