Skip to content

Check if constraint synonym satisfies functional dependencies

When we resolve #12679 (closed), it will be possible to implement an abstract type class using a constraint synonym. However, in my implementation, I didn't implement functional dependency checking:

signature H where
  class F a b | a -> b

-- This should be an invalid implementation
module H where
  type F a b = (Eq a, Eq b)

The check is annoying fiddly: we have to descend into the constraint synonym, collect all the implied fundeps, and then see if we have the ones we need, so I didn't implement it. Maybe some time.

Trac metadata
Trac field Value
Version 8.1
Type Bug
TypeOfFailure OtherFailure
Priority low
Resolution Unresolved
Component Compiler (Type checker)
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