Opened 3 years ago

Last modified 7 months ago

#12612 new bug

Allow kinds of associated types to depend on earlier associated types

Reported by: davemenendez Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: TypeInType Cc: int-index
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #11962, #15942 Differential Rev(s):
Wiki Page:


GHC rejects the following code:

class C t where
    type K t :: Type
    type T t :: K t -> Type

    m :: t -> T t a

with this error message

    • Type constructor ‘K’ cannot be used here
        (it is defined and used in the same recursive group)
    • In the kind ‘K t -> Type’

See e-mail discussion. This is connected to #12088, at least as far as defining instances of C.

Change History (6)

comment:1 Changed 3 years ago by simonpj

Keywords: TypeInType added

comment:2 Changed 3 years ago by goldfire

This is much simpler than #12088. It's loosely related, but solving #12088 will not help nor hurt our ability to solve this.

Yes, this should work.

comment:3 Changed 16 months ago by RyanGlScott

comment:4 Changed 15 months ago by andrewthad

For what it's worth, a fix for this would also help simplify some of my code.

comment:5 Changed 10 months ago by RyanGlScott

comment:6 Changed 7 months ago by int-index

Cc: int-index added
Note: See TracTickets for help on using tickets.