| Start |
|---|
Prelude Logical
Arithmetic operatorsThe numerical operators Unlike ** (opens new window) implements real-number exponentiation. This works for very general arguments, but is more computionally expensive than ^ or ^^, and generally incurs small floating-point errors. ListsThere are two concatenation operators:
Note that indexing lists is inefficient (complexity O(n) instead of O(1) for arrays (opens new window) or O(log n) for maps (opens new window)); it's generally preferred in Haskell to deconstruct lists by folding ot pattern matching instead of indexing. Control flowThis operator is mostly used to avoid parentheses. It also has a strict version . (opens new window) composes functions. |
| Finding information about infix operators Because infixes are so common in Haskell, you will regularly need to look up their signature etc.. Fortunately, this is just as easy as for any other function: This tells me that |
| Custom operators In Haskell, you can define any infix operator you like. For example, I could define the list-enveloping operator as You should always give such operators a fixity declaration (opens new window), like (which would mean RemarksMost Haskell functions are called with the function name followed by arguments (prefix notation). For functions that accept two arguments like (+), it sometimes makes sense to provide an argument before and after the function (infix). |
Read Article
https://develop.horje.com/learn/1434/reference