CSC324H5 Lecture Notes - Lecture 4: Type System, Pattern Matching, Eval
Document Summary
- work ow: write le and load in repl ghci. - \x -> x + 4 in repl err: repl want to convert to str to output. - use let x = 10 in repl. - use x = 10 in source le x = 10 f1 = \x -> x + 4 f2 x = x + 4 -- nicer syntax, only di . - (+) 3 4 -- equiv: 3 + 4 x y = x + y * 100. - let in haskell, similar to let* in racket g y = let x = y + 3 z = 10 w = x + y in x + y * z - w. - just like racket macros myf 3 = 100 myf x = 32 + x. - if only have myf 5 = 100. - cons: 1 : [2, 3] (in x), (:) 1 [2, 3] (pre x)