Feature request: Vacuous/error constraint (related to 7.7 closed type families regression)

I was trying to fix one of my closed type families examples for the new syntax, and run into an unfortunate issue. Due to a kind error in my code one of my constraints was being silently discarded (see ticket: https://ghc.haskell.org/trac/ghc/ticket/8669) The main reason I resorted to this (in hindsight) ill-kinded hack is the lack of a vacuous (i.e. never holding) constraint to produce type errors. I would love to be able to explicitly force GHC into realising "this constraint can never hold", if I had the ability to pass along a String/Symbol to be reported to the user, that would be even better. Cheers, Merijn

You can of course produce an infinite set of vacuous constraints using
the Symbol type (or any two non-equal types). For example, here you
could use:
Restrict a (a ': as) = ("Error" ~ "Oops! Tried to apply a restricted type!")
Erik
On Tue, Jan 14, 2014 at 2:56 PM, Merijn Verstraaten
I was trying to fix one of my closed type families examples for the new syntax, and run into an unfortunate issue. Due to a kind error in my code one of my constraints was being silently discarded (see ticket: https://ghc.haskell.org/trac/ghc/ticket/8669)
The main reason I resorted to this (in hindsight) ill-kinded hack is the lack of a vacuous (i.e. never holding) constraint to produce type errors. I would love to be able to explicitly force GHC into realising "this constraint can never hold", if I had the ability to pass along a String/Symbol to be reported to the user, that would be even better.
Cheers, Merijn
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Hi Merijn,
Let me suggest the Fail type family in
http://www.haskell.org/pipermail/haskell-cafe/2013-November/111549.html
--
Adam
On Tue, Jan 14, 2014 at 8:56 AM, Merijn Verstraaten
I was trying to fix one of my closed type families examples for the new syntax, and run into an unfortunate issue. Due to a kind error in my code one of my constraints was being silently discarded (see ticket: https://ghc.haskell.org/trac/ghc/ticket/8669)
The main reason I resorted to this (in hindsight) ill-kinded hack is the lack of a vacuous (i.e. never holding) constraint to produce type errors. I would love to be able to explicitly force GHC into realising "this constraint can never hold", if I had the ability to pass along a String/Symbol to be reported to the user, that would be even better.
Cheers, Merijn
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (3)
-
adam vogt
-
Erik Hesselink
-
Merijn Verstraaten