SML Flashcards
(T/F) In ML, programs are functions.
True
(T/F) In ML, running a program is evaluating an expression.
True
Do pure functional programming languages have assignment statements?
No
In ML, do functions have types?
Yes
Primitive Type:
int, real, char, string, and bool.
(T/F) In ML, types are not inferred.
False
What is the type of the following function?
What is the type of the following function?
‘a is a type variable.
‘a list is a list of whatever type ‘a is therefore size is a polymorphic function.
What is a polymorphic function?
A funciton that works with many different types.
In this example, what type does the plus sign default to?
This function defaults to int.
What has to happen to override the type to a real value?
What are curried functions?
In ML, what is the purpose of the @ symbol?
Give an example of a tuple in SML:
Give an example of a list in SML:
What is the keyword that declares a new variable and binds it to a value?