{-# 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?!?

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to