What does infixr mean in Haskell?

8

What is and what is this infixr 3 & & amp;

infixr 3 &&
(&&) :: Bool -> Bool -> Bool
True && True = True
_ && _ = False
    
asked by anonymous 20.07.2016 / 16:27

1 answer

6

Infixed notation means that the operator comes between the operands, for example 1 + 1 . Functions in haskell generally use postfixed notation, such as pow 1 2 .

r or l refers to associativity, r to right associativity

In your example True && True && True will be interpreted as True && (True && True)

The number refers to precedence, the greater the number, the greater the precedence.

    
07.02.2017 / 22:10