Ticket #3447 (new feature request)
Class restrictions on type instances
| Reported by: | LysikovVV | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | _|_ |
| Component: | Compiler | Version: | 6.10.4 |
| Keywords: | Cc: | Conor.McBride@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
I'm using type families to implement bools and integers on type level.
There is a class BoolT with with two instances and type families representing usual boolean functions, e.g. NotT. By semantics of NotT, implication (BoolT a) => (BoolT (NotT a)) holds, but I cannot specify this to compiler, and using BoolT with NotT is painful.
So I think there must be syntactic construction to restrict type family instances to some class, something like
type family NotT a
with (BoolT a) => (BoolT (NotT a))
or
class BoolT a where
type NotT a
with BoolT (NotT a)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

