Reputation: 97
So I wanted to understand the functions foldl
and foldr
in Hoogle
they say that these functions apply to binary operators. But I don't get what these binary operators are. I know that (+)
and (-)
are binary operators but what defines them ?
Upvotes: 2
Views: 3477
Reputation: 476709
Usually mathematicians define a binary operator is a function that takes two arguments. In some papers it is a requirement that the arguments and the result are defined over the same set.
The fact that the function ?
takes two arguments results in the fact that mathematicians frequently use infix notation (like x ? y
). For instance (+)
, (*)
, etc. are clearly binary operators.
Upvotes: 3