Opened 4 years ago

Closed 4 years ago

#10713 closed bug (fixed)

Type family not reducing over data family

Reported by: acowley Owned by: goldfire
Priority: normal Milestone: 7.10.3
Component: Compiler (Type checker) Version: 7.8.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: indexed-types/should_compile/T10713
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Given this code,

type family TEq t s where
  TEq t t = 'True
  TEq t s = 'False
data family T a

I expected this GHCi interaction to reduce: :kind! TEq (T Int) (T Bool)

But it does not. It does reduce (to 'True) if you instead ask,

:kind! TEq (T Int) (T Int)

Tested on GHC 7.10.2

Change History (5)

comment:1 Changed 4 years ago by thomie


comment:2 Changed 4 years ago by goldfire

Owner: set to goldfire

Good point. I know what is going on here.

comment:3 Changed 4 years ago by Richard Eisenberg <eir@…>

In f063bd54/ghc:

Fix #10713.

When doing the apartness/flattening thing, we really only need to
eliminate non-generative tycons, not *all* families. (Data families
are indeed generative!)

comment:4 Changed 4 years ago by goldfire

Milestone: 7.10.3
Status: newmerge
Test Case: indexed-types/should_compile/T10713

All set now. This should be quite straightforward to merge.

comment:5 Changed 4 years ago by bgamari

Resolution: fixed
Status: mergeclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.