[Haskell-cafe] Type classes

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Tue May 28 23:11:53 CEST 2013


On Tue, May 28, 2013 at 09:09:48PM +0200, Johannes Gerer wrote:
> What about these two very simple type classes. Are they equivalent?
[...]
> class Pointed f where
>   pure  :: a -> f a
> 
> class Unit f where
>   unit :: f a a
> 
> newtype UnitPointed f a = UnitPointed f a a
> instance Unit f => Pointed (UnitPointed f) where
>   pure f = UnitPointed unit
> 
> newtype Kleisli f a b = Kleisli (a -> f b)
> instance Pointed f => Unit (Kleisli f) where
>   unit = Kleisli pure

This is implausible, since "pure f" does not depend on "f".



More information about the Haskell-Cafe mailing list