defining functions Flashcards
curried functions
functions with multiple arguments that return functions as a result
what is the benefit of curried functions
create simpler functions via partial application
lambda expression
functions without a name
what are the 2 benefits of lambda functions
helps explain currying
dont have to name functions that are only called once
operator sections
putting the operation before the two arguments creating a curried function
either function
returns either of two types
maybe function
returns nothing or just
why do we use either and maybe functions
some programs may fail so these allow you to at least return something useful
total functions
defined for all possible functions of its type
always terminates
how can we turn a partial function into a total one
using either or maybe
partial function
only defined for some of the functions of its type