Feedback 2, the Revenge
The quarter's about 2/3 over. I'd like some more feedback. Here's the URL:
Questions you might want to answer:
- Did the section help you prepare for the midterm? How would you like quiz section to change to better prepare you for the future (e.g. the final)?
- Would you like section to be more interactive? Should we do more of any of the following: (a) hands-on exercises, (b) free/guided discussion
- Are there any topics kind that you would like me to cover? This can include programming languages issues that might not be directly related to the class.
- Any other suggestions or comments are welcome.
Algebraic and abstract types in Miranda
Miranda supports user-defined types of two varieties. Algebraic types are a single concept that encompasses enumerations, unions, and some uses of structured (record) types in other languages. Abstract types roughly correspond to the idea of an object or module.
Algebraic types
|| Enumerations weekday ::= Mon | Tue | Wed | Thu | Fri weekend ::= Sat | Sun || A union day ::= InWeek weekday | NonWeek weekend || Two structured types numlist ::= NullNumNode | NumNode num numlist list * ::= NullNode | Node (*) (list *)
Mon:: => weekday Sat:: => weekend InWeek Mon:: => day NumNode 5 NullNumNode:: => numlist Node 5 NullNode:: => list num Node 'a' NullNode:: => list char