Sep 21, 2024
add
function with two arguments behaves as a function taking an int
and returning another function.add
function with arguments grouped into a tuple.length
function works on lists of any type.a
) indicates generalization over types.fst
, reverse
, head
, map
.
fst
: Takes a tuple and returns the first element.reverse
: Reverses a list while maintaining type.head
: Returns the first element of a list.map
: Applies a function to each element of a list, transforming types..
used for composing functions.last
function using head
and reverse
.eq
for equality).Eq
: Equality operations.Ord
: Orderable operations, dependent on Eq
.Num
: Basic arithmetic operations.Fractional
: Division operations.sum
function uses Num
type class for addition.map
.map
.