Opened 14 months ago

Last modified 14 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: 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 (2)

comment:1 Changed 14 months ago by simonpj

Keywords: TypeInType added

comment:2 Changed 14 months 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.

Note: See TracTickets for help on using tickets.