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>
Sat, 18 May 2019 22:36:09 +0000 (23:36 +0100)
commit8a66ac4f81c3d1eab3b13a9e58cee0098573eff1
tree4bbee8ace5f4cb7d9dfd299cdcbe85ecc3fd0705
parent45afeea77cd017d2ac37cf330c595c22c90a7f87
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