next :: Integer -> Integer next x = x + 1 twice :: (a -> a) -> (a -> a) twice f x = f (f x) main = print $ twice twice twice twice next 0
twice
interface F<A,B> { B apply(A x); }