Opened 6 months ago

#16412 new feature request

Type family signatures in indefinite modules

Reported by: andrewthad Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.6.4
Keywords: backpack Cc: ezyang
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Backpack does not allow type family signatures in indefinite modules. As an example, although GHC does accept:

-- indefinite module
data Foo :: Bool
-- implementing module
type Foo = 'True

It does not accept:

-- indefinite module
type family Foo (b :: Bool) :: Bool
-- implementing module
type family Foo (b :: Bool) :: Bool where
  Foo 'True = 'False
  Foo 'False = 'True

I'm not sure if there is a fundamental reason for this (e.g. a requirement that everything is matchable). It would be helpful for the thing I'm experimenting with if this restriction could be lifted.

Change History (0)

Note: See TracTickets for help on using tickets.