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

59 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+
$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