[Haskell-cafe] Re: Are type synonym families really equivalent to fundeps?

Chris Smith cdsmith at twu.net
Mon Sep 3 22:44:32 EDT 2007


ChrisK wrote:
> -- You need to help GHC more here:
> type instance A_T () = <explicit type you actually use with ()>
> type instance A_T (Var x) = <explicit type you actually use with (Var x)>
> type instance A_T [t] = t
> type instance A_T (RHS (Var x) a) = <explicit type you actually use ...>
> type instance A_T (RHS [t] a) = t

Chris, this actually isn't workable.  The problem is that there is no 
such thing as "explicit type you actually ue with ()".  If the type 
variable 'a' gets matched to () or (Var x), then t can be any type.  
That works currently.  I don't want to fix the type of 't', as this code 
goes in a library where different applications are using different types 
for 't'.

As I said, this is probably not really right, since () really doesn't 
determine a value for a; but it does work right now.

Just for kicks, I tried this:

   type instance A_T () = forall t. t

it didn't work.

-- 
Chris Smith



More information about the Haskell-Cafe mailing list