Greetings.

Why does Haskell let you write functions that are not a part of type class?
For example instead of

elem :: Eq a => a -> [a] -> Bool
map :: (a -> b) -> [a] -> [b]

class Container a where
    elem :: Eq b => b -> a b -> Bool
    map :: (b -> c) -> a b -> a c

would define methods that can work on all containers, and create a
discipline to write more reusable and generic functions.

Thanks


_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to