I think I’m starting to actually grasp Haskell’s monads. I’ve been reading the Haskell wikibook and this article on Monads as Containers…
And I’ve been dinking around just a little and little things like this are making sense to me:
Prelude> return("won't you take me to") >>= (\line -> putStrLn (line ++ " funKAYTOWN")) won't you take me to funKAYTOWN Prelude> ["won't you take me to"] >>= (\str -> [str ++ " funKAYTOWN"]) ["won't you take me to funKAYTOWN"] Prelude>
Cool. I’ve wanted to learn me some Haskell for a long time (I think I first checked it out in 2001?), but somehow the abstraction in monads was a little more than I could focus on. Now it’s starting, starting to make sense.
The fact that it’s been this hard to get me this far doesn’t suggest that I’m going to be a master Haskellist any time soon, but at least there’s some hope.