
13 Oct
2008
13 Oct
'08
2:51 p.m.
{-# LANGUAGE FlexibleInstances #-} module Overload where class Silly s where go :: s instance Silly ([x] -> [x]) where go = reverse instance Silly (Int -> Int) where go = (+1) Don't even ask. Suffice it to say, you *can* make Haskell support arbitrary overloading of function names like C++ has, _if_ you abuse the type system violently enough. Please, won't somebody think of the children?!?