Zusammenfassung der Ressource
Haskell - Starting Out
- Haskell is a functional lenguage
- Is very explicit in his functions
- Can't combine different types of data
- e.g. 5 + True
- Haskell have many functions already defined
- The functions have the value not the variables
- Functions are defined in a similar way that they are called
- We use ' to either denote a strict version of a function
- We can name our functions
- The functions can't begin with uppercase letters
- Haskell allows to work with lists
- We can name our lists
- Strings are just lists of characters
- ['H','E','L','L','O']
- Can put to lists together with ++ or :
- When use ++ Haskell walks through the whole list on the left side of the ++
- To put something at the beginning of a list use the :
- In Haskell the lists have a particular structure
- The head is the first element in the list
- The tail is the all list less the head
- Last is the last element in the list
- Init is the all list less the last element in the list
- The lists can be created starting from ranges or limits
- e.g. [1..20]
- You can also use ranges to make infinite lists by just not specifying an upper limit.
- You can create lists comprehension
- hey're normally used for building more specific sets out of general sets