
18 Jan
2002
18 Jan
'02
8:06 a.m.
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