Last active
August 29, 2015 14:19
-
-
Save ssd532/70d6ec5cf2d66c839bf2 to your computer and use it in GitHub Desktop.
Haskell: names of notations and operators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notations | |
.. - enumeration | |
:: - It's not really a notation but still... x :: y means "the expression x has the type y" | |
- Alternatively, from Real World Haskell "The combination of :: and the type after it is called a type signature." | |
lines :: String -> [String] | |
We can read the -> above as “to”, which loosely translates to “returns”. The signature as a whole thus reads as “lines has the type String to list-of-String”. Let's try applying the function. | |
Operators | |
operators on lists | |
++ - concatination - concatinate two lists | |
: - cons (short for construct) - adds element to the list | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment