[GHC] #8423: contraint solver doesn't reduce reducible closed type family expressions (even with undecidable instances!)
GHC
ghc-devs
Tue Oct 8 22:00:56 UTC 2013
#8423: contraint solver doesn't reduce reducible closed type family expressions
(even with undecidable instances!)
-------------------------------------------+-------------------------------
Reporter: carter | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.8.1
Component: Compiler (Type checker) | Version: 7.7
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
-------------------------------------------+-------------------------------
attached is an example where the type checker isn't "computing" in the
closed type families, or at least doing a one step reduction.
this makes sense, given that type families only compute when
instantiated...
But if we could partially evaluate closed type families (or at least do a
one step reduction), the attached example code would type check!
interestingly, depending on what order the cases for the PSum are written,
the type error changes!
I guess I want an "eager matching" closed type family, that when partially
instantiated will patch on the first pattern it satisfies, to complement
ordered type families.
attached is a toy example where I otherwise need an unsafeCoerce to make
things type check
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8423>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list