type families + GADT = type unsafety?

Roberto Zunino zunino at di.unipi.it
Thu Sep 20 17:58:16 EDT 2007


(Trac reports "database locked", posting here...)

Here's unsafeCoerce:

> type family Const a
> type instance Const a = ()
> 
> data T a where T :: a -> T (Const a)
> 
> coerce :: forall a b . a -> b
> coerce x = case T x :: T (Const b) of
>            T y -> y

And this indeed "works"... Here's the result with the latest RC:

*TypeFam> coerce () 2
<interactive>: internal error: stg_ap_v_ret
    (GHC version 6.9.20070918 for x86_64_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Aborted

Regards,
Zun.


More information about the Glasgow-haskell-users mailing list