CSC302 2011S, Class 13: Scala (2) Overview: * Lab. Admin: * Welcome to any alums who may be visiting! * Assignment 5 released. * Sorry for being behind in stuff. Grading 30 exams was disruptive. * EC for Thursday extra: Walker. * EC for Friday CS Table: GPUs. Lab Questions Ooh ... it's weirdly sweet > sump((1,2)) Int 3 > sump(1,2) Int 3 Or is it sour? > pair(1,2) ((1,2), (1,2)) Function types: Int=>Int, a function from ints to ints E.g. def applyto1(f: Int=>Int): Int = f(1) compose(f,g)(x) == f(g(x)) Or "f o g" in many calculus textbooks def compose[In,Mid,Out](f: Mid=>Out, g: In=>Mid) = { x: In => f(g(x)) } def x: Map[Any,Any] = Map()