Opened 2 years ago

Last modified 3 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:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #11962 Differential Rev(s):
Wiki Page:

Description

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 (4)

comment:1 Changed 2 years ago by simonpj

Keywords: TypeInType added

comment:2 Changed 2 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 4 months ago by RyanGlScott

comment:4 Changed 3 months ago by andrewthad

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

Note: See TracTickets for help on using tickets.