Rohan Drape schrieb:

> i've often wondered about an alternate 'do' notation
> with a left-to-right rule such that if 'a' and 'y' are
> monadic values as in:
> 
>   do a' <- a
>      y' <- y
>      return (a' + b / (x * y'))
> 
> we could instead write:
> 
>   ^a + b / (x * ^y)
> 
> or even drop the ^ (or whatever symbol) and have the
> re-writing be 'type-directed'.

I have not followed this thread closely ... You may overload +, *, / in
order to work on your particular monad. Actually, for these kinds of
operations Applicative Functors are enough, and their combinators allow
functional style of writing also for non-overloaded functions. However,
Eq class cannot be easily overloaded this way.

_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to