
14 Dec
2010
14 Dec
'10
9:59 p.m.
Quick question: Why do I need the $ in the following bits of code?
main = withSocketsDo $ do --do something with sockets
foo = fromMaybe 0 $ do --do something in the maybe monad
I don't see (after admittedly only a minute or so thinking about it) where any grammar ambiguities would be if 'do' had an implicit $ in front of it:
foo = fromMaybe 0 do --do something in maybe
Though now that I've written it down, that is hard for me to visually parse at a glance. I'm still curious though. --Jonathan