Name: Anonymous 2008-09-01 7:21
IMPLEMENT THE COLLECTOR!!!
(((((o) 'a) 'b) 'c)) ; => (a b c)
(((((o) 'a) 'b) 'c)) ; => (a b c)
class Collect a where
collect :: ([Int] -> [Int]) -> a
instance Collect [Int] where
collect acc = acc []
instance (Integral t, Collect b) => Collect (t -> b) where
collect acc x = collect (acc . (fromIntegral x:))
*Main> o 1 2 3 :: [Int]
[1,2,3]