
16 May
2015
16 May
'15
4:58 p.m.
Hi, I’me writing a simple parser and can test it in GHCI parseTest moveParser "(1,2)->(3,3)” and I get what I expect i.e. Move {from = Location 1 2, to = Location 3 3} I now have a text file (test.txt) with lots of (1,2)->(3,3) (3,6)->(3,9) etc etc and I really can’t see how I get the contents of the text file into the parser!! I have main = do handle <- openFile "test.txt" ReadMode contents <- hGetContents handle !! what goes here!!! - how do I invoke moveParser with contents ?? Thanks Mike