[Haskell-cafe] Re: Newbie question

Jon Fairbairn jon.fairbairn at cl.cam.ac.uk
Tue Jan 22 05:04:48 EST 2008


Bulat Ziganshin <bulat.ziganshin at gmail.com> writes:

> Hello Jon,
>
> Monday, January 21, 2008, 9:28:09 PM, you wrote:
>
>>> Ok. I have a my own class "class A a" and want to write function like
>>> this  "f:: (A a)=>Integer->a". Can I do it?
>
>> But in general you are going to want something a bit more
>> useful, which means that you have to have a path from
>> Integer to a
>
> i.e. you should have other functions that produce A from Integer and
> at the last end this means that class A should provide some way to
> do it

I'm not sure we're using the same terminology. In the
example I gave, the class A doesn't provide anything from
Integer to a, unless defining an overloaded function outside
the class definition counts as the class providing something.

-- 
Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk




More information about the Haskell-Cafe mailing list