
For example all functions with Int -> Int are type equivalent However,
data D a b = MkD a b
All objects D Int Int are type equivalent. I'm not sure what your question means, otherwise. If you define data Function a b = F (a -> b) apply:: Function a b -> a -> b apply (F f) a = f a you add an extra level of constructor, but you can still use anything of type Function Int Int where Function Int Int is required: square:: Function Int Int square = F (\ a -> a*a) sqare_root:: Function Int Int square_root = F (\ a -> round (sqrt (fromIntegral a))) E&OE -- it's about my bedtime. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!)