Thank you that is very interesting... this is really impressive with haskell that it's so "easy" to add such operators, that they don't need to be builtin.

Thanks for your time, it was not wasted!

On Wed, Oct 31, 2012 at 6:26 PM, Daniel Trstenjak <daniel.trstenjak@gmail.com> wrote:

On Wed, Oct 31, 2012 at 06:14:52PM +0100, Daniel Trstenjak wrote:
> (<&&>) :: Monad m => m Bool -> m Bool -> m Bool
> (<&&>) m1 m2 = do
>    r1 <- m1
>    if r1 then m2 else return False
>
>
> (<||>) :: Monad m => m Bool -> m Bool -> m Bool
> (<||>) m1 m2 = do
>    r1 <- m1
>    if r1 then return True else m2

That the operators behave like the boolean ones we should have the same fixity declarations:

infixr 3 (<&&>)
infixr 2 (<||>)


Greetings,
Daniel

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners