[GHC] #11715: Constraint vs *
GHC
ghc-devs at haskell.org
Tue Dec 6 21:24:46 UTC 2016
#11715: Constraint vs *
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: new
Priority: high | Milestone: 8.2.1
Component: Compiler (Type | Version: 8.0.1-rc1
checker) |
Resolution: | Keywords: Typeable
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 int-index):
Couldn't we theoretically have constraints passed as unboxed data? In
https://ghc.haskell.org/trac/ghc/wiki/UnliftedDataTypes I see that Edward
Kmett suggests a separate flag to `TYPE`, `Constraintiness`, which would
be more disciplined than misusing `RuntimeRep` and would solve the same
problems.
Except I think that it should be called `Coherency`, not
`Constraintiness`, because the main feature of things that go to the left
of `=>` is that they should have coherency properties (as was already
discussed).
{{{
data Coherency = Coherent | Incoherent
}}}
This way we can even make `->` coherency-polymorphic (and eliminate
`Dict`, that would be safe). `=>` could then require something `Coherent`,
and `-XIncoherentContexts` (a companion to `-XIncoherentInstances`) could
lift this restriction.
Then `Int =>` would be disallowed unless the pragma is specified, but none
of my objections would apply.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11715#comment:52>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list