CISC 260 Lecture Notes - Lecture 4: Boolean Expression, Category 3 Cable, Quicksort

38 views2 pages

Document Summary

<= : less than or equal to newyear : : int - binding definition, declare a type requires a double colon newyear = 2017 newyear : : integer -unbounded type. Haskell indentation is part of the language - will cause errors if incorrect. Guard notation: a condition/ guard & setting with a value if condition is true. | n<0 && mod n 2 /= 0 = "c" | n>0 && mod n 2 == 0 = "d" | n>0 && mod n 2 /= 0 = "e" -- clause/alternative. Simplified conditions: using logic to decide to not use all the conditions above. | n<0 && mod n 2 == 0 = "b" | n<0 = "c" - if it wasn"t even and above 0, it must be odd. | mod n 2 == 0 = "d" | true = "e" - if it doesn"t apply to any of the.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions