Opened 3 years ago

Last modified 3 years ago

#12704 new bug

Check if constraint synonym satisfies functional dependencies

Reported by: ezyang Owned by:
Priority: low Milestone:
Component: Compiler (Type checker) Version: 8.1
Keywords: FunDeps 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:


When we resolve #12679, 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.

Change History (2)

comment:1 Changed 3 years ago by goldfire

By "I didn't implement it", do you mean that you disallow the fundep? Or just not check the implementation? The former seems better. :)

comment:2 Changed 3 years ago by simonpj

Keywords: FunDeps added
Note: See TracTickets for help on using tickets.