Re: [Haskell] Empty instance declaration

2007-12-28 Thread Benja Fallenstein
On Dec 28, 2007 5:14 PM, Mike Haskel <[EMAIL PROTECTED]> wrote: > You can define Show as a data type, rather than a type class: > > type Show a = Either (a -> String) (Int -> a -> String -> String) ... > The constructors for Show make explicit the two ways to define an > instance. This technique a

Re: [Haskell] Class type constraining?

2007-06-22 Thread Benja Fallenstein
2007/6/22, Hugo Pacheco <[EMAIL PROTECTED]>: class Functor f => C f a b | f a -> b where ftest :: f a -> b I want to write some function test :: (C f a b) => (a -> b) test = ftest . undefined I'm not sure whether this is what you want, but the "obvious" way to make this type-check would se