23 May
2007
23 May
'07
6 p.m.
On 23/05/07, David House <dmhouse@gmail.com> wrote:
Why should it compile? Expressions in a do-block have to have the type m a for some monad m, don't they?
Further developments on #haskell: <SamB_XP> dmhouse: where in the report does it say that do blocks constrain types inherently? <dmhouse> SamB_XP: I was under that impression, nothing more. <SamB_XP> dmhouse: ah. <SamB_XP> well, you would kind of think it would. but it looks like do is defined by translation, and like the Monad constraint only comes from >> and >>= <dmhouse> SamB_XP: right, so do (1 :: Int); (2 :: Int) is illegal as it doesn't match the type of (>>), but do (1 :: Int) isn't? <SamB_XP> dmhouse: so it would seem -- -David House, dmhouse@gmail.com