def twice[A](func: A=>A)= (a:A) => func(func(a)); def chain[A](f1: A=>A, f2: A=>A)= (a:A) => f1(f2(a)); val appendMark = (a:String) => a + "!"; val prependMark = (a:String) => "!" + a; println( twice(chain(appendMark,prependMark))("Hello"));
Wednesday, September 26, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment