[Haskell-cafe] Non-atomic "atoms" for type-level programming

Tillmann Rendel rendel at cs.au.dk
Wed Apr 29 06:07:34 EDT 2009


Hi again,

Tillmann Rendel wrote:
>   {-# LANGUAGE TypeFamilies #-}
>   module D (ok) where
>     import A
>     import B
> 
>     data D client = D client
> 
>     type family Label client
>     type instance A.Label (D client) = D.Label client
>     type instance B.Label (D client) = D.Label client
> 
>     ok :: client -> [D.Label client]
>     ok client = [ A.z (D client), B.z (D client)]

Oh, and note that I do not need UndecidableInstances here, because I 
match against the explicit module identity D.

   Tillmann


More information about the Haskell-Cafe mailing list