
19 Sep
2014
19 Sep
'14
8:40 a.m.
Tushar Jarhad
let mm = decode input :: Maybe Tweet
You have told the program you expect one tweet---anything else is, by definition, an error. The program takes you at your word. So if you want it to parse multiple tweets, tell it that you expect a *list* of tweets.
let mm = decode input :: Maybe [Tweet]
Or are you saying that your file simply has multiple tweets appended one after another? If so, that file does not represent a valid JSON structure. I feel sure there's a way to run the parse incrementally---taking a complete data structure at a time---but I don't know it offhand. Mike.