Oct 8, 2003 ------------- - More on ML: topics covered today - code for mergesort - function composition - our own operator - ML's infix operator - currying, partial evaluation - use of map (a higher order function) fun split(nil) = (nil,nil) | split([a]) = (nil,[a]) | split(x::y::excess) = let val (l,r) = split(excess) in (x::l,y::r) end; fun merge(nil,a) = a | merge(a,nil) = a | merge(L1 as x::xs, L2 as y::ys) = if (x