[Haskell-cafe] Kind-agnostic type classes

Derek Elkins derek.a.elkins at gmail.com
Fri Oct 3 09:23:10 EDT 2008


On Fri, 2008-10-03 at 12:22 +0200, Florian Weimer wrote:
> I'm trying to encode a well-known, informally-specified type system in
> Haskell.  What causes problems for me is that type classes force types
> to be of a specific kind.  The system I'm targeting however assumes that
> its equivalent of type classes are kind-agnositic.
> 
> For instance, I've got
> 
> class Assignable a where
>     assign :: a -> a -> IO ()
> 
> class Swappable a where
>     swap :: a -> a -> IO ()
> 
> class CopyConstructible a where
>     copy :: a -> IO a
> 
> class (Assignable a, CopyConstructible a) => ContainerType a
> 
> class (Swappable c, Assignable c, CopyConstructible c) => Container c where
>     size :: (Num i, ContainerType t) => c t -> IO i

instane Container Maybe where...

What does copy :: Maybe -> IO Maybe mean?



More information about the Haskell-Cafe mailing list