This has everything you need to parse a file - in ParseProg you will find progToAST which will parse a string and return an abstract syntatx tree, and parseFile which will open a file and parse it, returing an IO (AST.Prog String String).
You should use these to test your program on functions.
All of this code is due to Prashant Kumar.