CISC 260 Lecture Notes - Lecture 2: Type Inference, Eval, In C

58 views4 pages

Document Summary

Intro to haskell: ghc / haskell winghci. - these are comment markers, in this word doc, i have used a mix of these and // :r = reload: parameters, int -> int -> int -- takes 2 ints and returns an int, (int->int) -> int -> bool -- takes a function, an int and returns a bool. Types: newval :: int, function: qsort :: [int] -> [int] // defines that it is type list of ints and returns a list of ints. Integral super type: int // bound (theres a range, integer // unbound, cannot mix these two, char, string, can infer types, to find type, ex for / , :type (/) fromintegral floor truncate to int. Ex: av :: float -> float -> float av x y = (x+y)/2. Ex2: import data. char nextchar :: char -> char nextchar c = chr((ord c) + 1)

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