Commit a4d9a407 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Test Trac #4484

parent 15353f89
{-# LANGUAGE TypeFamilies, EmptyDataDecls, GADTs #-}
module T4484 where
type family F f :: *
data Id c = Id
type instance F (Id c) = c
data C :: * -> * where
C :: f -> C (W (F f))
data W :: * -> *
fails :: C a -> C a
fails (C _)
= -- We know (W (F f) ~ a)
C Id -- We need (a ~ W (F (Id beta)))
-- ie (a ~ W beta)
-- Use the equality; we need
-- (W (F f) ~ W beta)
-- ie (F f ~ beta)
-- Solve with beta := f
works :: C (W a) -> C (W a)
works (C _)
= -- We know (W (F f) ~ W a)
C Id -- We need (W a ~ W (F (Id beta)))
-- ie (W a ~ W beta)
-- Solve with beta := a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment