Skip to content

Instantly share code, notes, and snippets.

@ssd532
Last active August 29, 2015 14:19
Show Gist options
  • Save ssd532/70d6ec5cf2d66c839bf2 to your computer and use it in GitHub Desktop.
Save ssd532/70d6ec5cf2d66c839bf2 to your computer and use it in GitHub Desktop.
Haskell: names of notations and operators
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