Types and classes Flashcards
What is a type?
A name for a collection of related values
What is a function type?
Map values of one type to values of another
What is a curried function?
Function takes multiple arguments and returns one value (of one type)
What is a polymorphic function
A function where the type is of any type
What is an overloaded function
A polymorphic function which contains a class constraint (Num , Eq, Ord)
What is a type interface?
Type is calculated at compile time
What is a list type?
A sequence of values of the same time
What is a tuple type?
A sequence of values of different types (encodes size)
Give some examples of polymorphic functions in standard prelude
head
take
zip
id
fst
Give some examples of overloaded functions in the standard library
+ (Num)
== (Eq)
< (Ord)