On 16-Feb-1999, Michael Hobbs <[EMAIL PROTECTED]> wrote:
> I'm not sure if this can be cleanly done or not. (I've been able to do
> it less-than-cleanly.) What I want to do is define a class where the
> instance has an option of what type of parameters some of its functions
> can accept. For example, say I have
> 
> class Foo a where
>   write :: a -> b -> IO ()
> 
> This allows a particular instance's version of `write' to accept any
> type of value as the second parameter. However some instances may not be
> able to accept _any_ type of parameter; maybe some can only write
> Strings. I have been able to accomplish what I want by using a bit of a
> kludge:

What's wrong with

        class Foo a b where
                write :: a -> b -> IO ()

?

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger [EMAIL PROTECTED]        |     -- leaked Microsoft memo.



Reply via email to