Sections 4.1 and 4.2 Flashcards
Structured types in Miranda define one or more ____.
constructors
A generic type in Miranda is a ____ type in Haskell.
polymorphic
A type-forming operator in Miranda is a ____ in Haskell.
type constructor
Lists and tuples can be translated to values of ____ types.
structured
A structured type with exactly one constructor is a ___ type.
product type
A structured type with two or more constructors is a ____ type.
sum type
True or false: Structured types are also known as algebraic data types.
True
True or false: The ordering of equations in a function definition can matter when patterns are involved.
True
Constant patterns can be expressed as ____.
guards
Name the three constructs added to the enriched lambda calculus in order to support pattern matching.
Pattern-matching lambda abstractions, FAIL, and []
A pattern-matching lambda abstract either returns a regular value or ____.
FAIL
True or false: [] is strict in its first argument.
True
True or false: [] is strict in its second argument.
False
Why is a reduction rule for FAIL needed?
So that normal function application to a (curried) function of multiple arguments produces the desired result on pattern match failure.
TR translates guarded right hand sides (RHSs) into ___.
a nested IF
TR translates RHSs with a where clause into a ____.
letrec expression
True or false: The scope of the where clause ranges over all the RHSs.
True