#3447: Class restrictions on type instances
-----------------------------+----------------------------------------------
Reporter: LysikovVV | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 6.10.4 | Severity: normal
Keywords: | Testcase:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
-----------------------------+----------------------------------------------
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)
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3447>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs