[Haskell-cafe] a bunch of newbie questions

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Aug 4 16:29:13 EDT 2006


Hello Brian,

Friday, August 4, 2006, 8:50:25 PM, you wrote:

>         class Bar a b where
>             bar :: a -> b

> (*) But there's one exception: you can't use typeclasses to resolve
> overloadings between values and functions because non-function values don't
> have a type of the form A -> B:

>         cool :: Int
>         cool :: Char -> String

>         class Cool -- Ooops! fundamental problem encountered ;-)

class Cool a where
    cool :: a

instance Cool Int
instance Cool (Char -> String)

?


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list