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)
commit310a2212dfb2014e8ac7efd1a5d7599a7f9d4057
tree4bbee8ace5f4cb7d9dfd299cdcbe85ecc3fd0705
parentc462c53c917525cb2b4ff55f7d86efffb3944d2c
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