[Haskell-cafe] [ghc-proposals/cafe] Partially applied type families

Alejandro Serrano Mena trupill at gmail.com
Wed May 24 07:57:09 UTC 2017

I know I am just jumping in the middle of an already long discussion.

> Bottom line: You win. I'm convinced. Apartness guards (feel free to fight
> me on the name here -- I don't feel strongly, but somehow I like "apartness
> guards" more than "disequality guards") subsume OverlappingInstances (when
> the author of the instances has a particular desired way to resolve
> overlap) and closed type families. I think that the syntax of closed type
> families is often what the user wants, but I admit that CTFs don't cover
> all scenarios, especially in the context of Constrained Type Families. So I
> think we should keep CTFs (for now -- until Dependent Haskell is here) but
> add this new syntax as well, which would subsume the newly-proposed closed
> type classes.
> Even better, I think apartness guards would be very easy to implement. All
> the plumbing is already installed: we basically just have to add a switch.
I would like to advise against this idea of apartness guards. I've tried
myself some years ago, and I remember them being quite complicated to
describe. The main problem is that apartness may end up introducing some
sort of backtracking in the type checking process -- something completely
undesirable. Furthermore, they make the work of the overlapping checks much

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170524/150a372a/attachment.html>

More information about the Haskell-Cafe mailing list