<div dir="ltr"><br><br><div class="gmail_quote">On Fri, Aug 29, 2008 at 6:41 AM, Maurício <span dir="ltr"><<a href="mailto:briqueabraque@yahoo.com">briqueabraque@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
<a href="http://haskell.org/haskellwiki/Keywords" target="_blank">http://haskell.org/haskellwiki/Keywords</a> says that:<br>
<br>
-------------<br>
[do is a] syntactic sugar for use with monadic<br>
expressions. For example:<br>
<br>
do { x ; result <- y ; foo result }<br>
<br>
is shorthand for:<br>
<br>
x >> y >>= \result -> foo result<br>
-------------<br>
<br>
I did some tests hiding Prelude.>> and Prelude.>>=<br>
and applying >> and >>= to non-monadic types, and<br>
saw that 'do' would not apply to them. So, I would<br>
like to add the following to that text:<br>
</blockquote><div><br>It sounds like you tried to redefine (>>) and (>>=) and make 'do' use the new definitions. This is not possible, regardless of what types you give (>>) and (>>=).<br>
<br>If you want to define (>>) and (>>=), do so for a particular instance of Monad.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
-------------<br>
as long as proper types apply:<br>
<br>
x :: Prelude.Monad a<br>
y :: Prelude.Monad b<br>
foo :: b -> Prelude.Monad c<br>
-------------<br>
<br>
Is that correct (Haskell and English)?<br>
<br>
Thanks,<br>
Maurício<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>