
20 May
2011
20 May
'11
11:36 p.m.
On Fri, 2011-05-20 at 19:04 -0700, michael rice wrote:
markov4.hs:35:27: Couldn't match expected type `Map k a' against inferred type `(Map Prefix [String], Prefix, [String])'
ghc seems to believe `mp' here is not just a map, but the entire state (which is what execState is meant to give you).
type GeneratorState = State ((Map Prefix [String]),Prefix,[String])
The state is a triple, so you need to match to get the real map out:
let (themap,_,_) = mp putStrLn $ show $ themap ! (non_word,non_word)