Mindmap
secondPart_<Higher order functions>
Inhalt der Mindmap
secondPart_<Higher order functions>
Currified functions
- call two parameters
->
- take and return
- naturally associative by right
infix functions
Higher order in your order
- Functions can take functions as parameters and also return functions
Associations and filters
- predicate
- function that says if something is true or false
- map :: (a -> b) -> [a] -> [b] map _ [] = [] map f (x:xs) = f x : map f xs
- filter :: (a -> Bool) -> [a] -> [a] filter _ [] = [] filter p (x:xs) | p x = x : filter p xs | otherwise = filter p xs
- predicate
Lambdas
- Lambdas are anonymous functions that are usually used when we need a function only once
- \
- (\xs -> length xs > 15)
Folds and origami
- Folds can be used to implement any function that traverses a list, item by item, and then return a value.
- Whenever you want to go through a list and return a value, there are possibilities of using a fold
- a fold takes a binary function, an initial value and a list to fold
- Folds can be used to implement any function that traverses a list, item by item, and then return a value.
$
- Basically it is a function of convenience that we use to avoid having to write many parentheses
- map a list of functions
- Basically it is a function of convenience that we use to avoid having to write many parentheses
Composition of functions
- is to perform a composition of functions with the previous function
Informationen
- Beschreibung
- Mindmap am secondPart_<Higher order functions>, erstellt von Nicolas Acosta am 01/03/2018.
- Erstellt von
- Nicolas Acosta
- Aufrufe
- 0
- Bewertung
Mehr zu Functional Programming and Haskell