-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Low PriorityThings that are good to have but not neededThings that are good to have but not neededquestionFurther information is requestedFurther information is requested
Description
Currently we assign a mirror $wf:ATC to an associated type ATC of class say C.
or
class C a where
type ATC a
op :: ...
gets elaborated to
class C a where
type ATC a
type $wf:ATC a :: Constraint
op :: ...
Will it be more appropriate to add the class constraint as the wellformedness mirror?
Possible problem may be that the associated data type has fewer type variables than the class variables potentially, giving rise to unambiguous types post elaboration.
Motivation:
There are cases where a data type references an associated type.
data IsNode a => Graph a = Graph { graphMap :: (Map (Key a) a) }
class Ord (Key a) => IsNode a where
type Key a :: *
nodeKey :: a -> Key a
nodeNeighbors :: a -> [Key a]
Metadata
Metadata
Assignees
Labels
Low PriorityThings that are good to have but not neededThings that are good to have but not neededquestionFurther information is requestedFurther information is requested