[Haskell-cafe] a bunch of newbie questions
Brian Hulley
brianh at metamilk.com
Fri Aug 4 17:32:22 EDT 2006
Bulat Ziganshin wrote:
> 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)
>
> ?
Yes thanks - someone else pointed this out to me off-list as well.
I think that mental block must have been caused by watching too many
episodes of Star Trek yesterday!
Ok I give up, there's just no excuse... ;-)
Brian.
--
Logic empowers us and Love gives us purpose.
Yet still phantoms restless for eras long past,
congealed in the present in unthought forms,
strive mightily unseen to destroy us.
http://www.metamilk.com
More information about the Haskell-Cafe
mailing list