Class restrictions on type instances
|Reported by:||LysikovVV||Owned by:|
|Component:||Compiler (Type checker)||Version:||6.10.4|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):|
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))
class BoolT a where type NotT a with BoolT (NotT a)
Change History (10)
Changed 7 years ago by LysikovVV
comment:8 Changed 2 years ago by thomie
- Component changed from Compiler to Compiler (Type checker)
- Type of failure set to None/Unknown