Skip to content

TypeFamilies don't seem to play with LIberalTypeSynonyms

I'm trying to do some type level programming and want to use type families, but also LiberalTypeSynonyms to allow passing in a type level identity:

The following works:

{-# LANGUAGE LiberalTypeSynonyms #-}

type Id x = x

type Generic t (i:: * -> *) = i t

foo :: Generic Int Id
foo = undefined

However, replacing Generic with a type family does not work:

{-# LANGUAGE LiberalTypeSynonyms #-}
{-# LANGUAGE TypeFamilies #-}

type Id x = x

type family Generic t (i:: * -> *)
type instance Generic Int i = i Int

foo :: Generic Int Id
foo = undefined

Hopefully I'm not over looking anything, but I can't see why this doesn't work.

Trac metadata
Trac field Value
Version 7.0.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information