
21 Sep
2014
21 Sep
'14
10:02 a.m.
Hi, I'm trying to get Graham Hutton's "Programming with Effects" article (http://www.cs.nott.ac.uk/~gmh/monads) working with Data.Tree instead of the Tree he provides. My code is here: https://gist.github.com/derekmcloughlin/95ab690e0c07c5a7221e The compiler is complaining about the use of lab <- mlabel c in the list comprehension: Couldn't match expected type β[Tree (a, Int)]β with actual type βST (Tree (a, Int))β This makes sense, but is there any way to execute the monad operation "mlabel" within the list comprehension? I've tried the MonadComprehensions extension but still get an error. Derek.