[Haskell] Swapping parameters and type classes

Bas van Dijk v.dijk.bas at gmail.com
Sun Sep 16 16:45:39 EDT 2007


On 9/16/07, Mads Lindstrøm <mads_lindstroem at yahoo.dk> wrote:
> But what if I want to "apply" the 'b' ? How do I do that ?

The following uses type families (functions) and compiles under GHC HEAD:

{-# OPTIONS_GHC -XTypeFamilies -XEmptyDataDecls -XTypeSynonymInstances #-}

data Foo a b

class Bar (x :: * -> *)

instance Bar (Foo a)

type family BarB a b :: * -> *
type instance BarB a b = Foo b

instance Bar (BarB a b)


regards,

Bas van Dijk


More information about the Haskell mailing list