COMPSCI 1JC3 Lecture Notes - Lecture 6: Tagged Union, Product Type, Binary Search Algorithm

28 views3 pages

Document Summary

A [a] (a za bool) [a] Purpose for z is to check whether x matches a value in z. If it returns true we have a match, if not we don"t have a match. Efficient but requires it to be already in ascending order. Important part of programming is choosing the right types. 2 main ways of creating types in haskell: Give a new name to an old type. A new name for an old type. We can use the new name wherever we can use the old type. Making names for types that already exist. Is a new name for an old type with parameters. A type with parameters that represents a family of types. Algebraic data type is a new type of new values formed as a sum of products . C are value constructors that creates new values. They allow us to construct new values from old values.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions