Re: Can we offer ~ without GADTs or type families?

Hi David,
Could we get a separate LANGUAGE pragma just for equality constraints?
I think we should, and I don't think we'd even need to introduce a new pragma, since there's already a perfectly good one: -XTypeOperators! After all, there's nothing really that special about (~) other than some typechecking details. A fix to Trac #9194 [1] would give us this. Ryan S. ----- [1] https://ghc.haskell.org/trac/ghc/ticket/9194

TypeOperators as a language extension doesn't require a whole lot on the
behalf of implementors today. They basically just have to add fixity
handling to types. This is a no-brainer for a compiler implementor. It is a
simple elaboration and some extra cases to deal with in their parser. The
typechecker changes are obvious.
Asking them to do all the things to support 'some typechecking details'
that aren't entirely trivial to support that same extension is an awful big
ask! OutsideIn(X) is a big paper to read, let alone implement, and the only
compiler to even try handling (~) today is GHC.
-Edward
On Fri, Aug 5, 2016 at 2:15 PM, Ryan Scott
Hi David,
Could we get a separate LANGUAGE pragma just for equality constraints?
I think we should, and I don't think we'd even need to introduce a new pragma, since there's already a perfectly good one: -XTypeOperators! After all, there's nothing really that special about (~) other than some typechecking details. A fix to Trac #9194 [1] would give us this.
Ryan S. ----- [1] https://ghc.haskell.org/trac/ghc/ticket/9194 _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Good point, I hadn't considered the perspective of other compilers. In
that case, I could be persuaded to introduce a separate pragma like
-XTypeEqualities, and have -XGADTs and -XTypeFamilies imply
-XTypeEqualities for backwards compatibility.
Ryan S.
On Fri, Aug 5, 2016 at 2:27 PM, Edward Kmett
TypeOperators as a language extension doesn't require a whole lot on the behalf of implementors today. They basically just have to add fixity handling to types. This is a no-brainer for a compiler implementor. It is a simple elaboration and some extra cases to deal with in their parser. The typechecker changes are obvious.
Asking them to do all the things to support 'some typechecking details' that aren't entirely trivial to support that same extension is an awful big ask! OutsideIn(X) is a big paper to read, let alone implement, and the only compiler to even try handling (~) today is GHC.
-Edward
On Fri, Aug 5, 2016 at 2:15 PM, Ryan Scott
wrote: Hi David,
Could we get a separate LANGUAGE pragma just for equality constraints?
I think we should, and I don't think we'd even need to introduce a new pragma, since there's already a perfectly good one: -XTypeOperators! After all, there's nothing really that special about (~) other than some typechecking details. A fix to Trac #9194 [1] would give us this.
Ryan S. ----- [1] https://ghc.haskell.org/trac/ghc/ticket/9194 _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (2)
-
Edward Kmett
-
Ryan Scott