[GHC] #12680: Permit type equality instances in signatures
GHC
ghc-devs at haskell.org
Mon Oct 10 19:03:11 UTC 2016
#12680: Permit type equality instances in signatures
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner:
Type: feature request | Status: new
Priority: low | Milestone:
Component: Compiler (Type | Version: 8.1
checker) |
Resolution: | Keywords: backpack
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by goldfire):
I've not followed the Backpack blow-by-blow, but using `data S` to denote
an abstract type of any stripe looks bad to me. `type S` is much better,
because users can't make any assumptions about a `type` declaration that
they might for a `data` declaration.
Separately, you could get yourself into deep water here (not that that's
necessary bad):
{{{
type Nat
type family (a :: Nat) + (b :: Nat)
instance a + b ~ b + a
}}}
Good luck implementing this signature! :)
It would be super awesome if the user could prove the equality manually.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12680#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list