what are integers
numbers with their negative counterparts including zero ( -1 . -2, -3 , 0 , 1 2 3 )
what are domain
A set of which the function input are chosen
What is codomain
This is the set of which output from a functionional programming
What are natural numbers
Start with 0 upward 1 , 2 , 3 ,4
What is rational numbers
This can represent fractions
What is irrational number
This cannot be represented as a fraction
WHat is high order functions
Functions that take a function as an argument or returns a functions as a result or both
What is map
Takes a second function and applies the list of elements before returning the new list
WHat is fold
Reduces the list to a single value
What is filter
Returns the elements of the list to adhere to the condition given
Features of a functional program
High order function
Immutable
Stateless
Describe how the total function works to add up all of the numbers in a list.
total [] = 0
total (x:xs) = x + total (xs)
It uses recursion
It splits the list to an head and tail
The recursion ends when the list is empty