[GHC] #10177: Typeable solver regression

GHC ghc-devs at haskell.org
Thu Mar 26 21:53:46 UTC 2015


#10177: Typeable solver regression
-------------------------------------+-------------------------------------
        Reporter:  glguy             |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  highest           |               Milestone:  7.10.1
       Component:  Compiler (Type    |                 Version:  7.10.1-rc3
  checker)                           |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  GHC rejects       |               Test Case:
  valid program                      |  testsuite/tests/typecheck/should_compile/T10177
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by diatchki):

 I don't think that there is anything wrong here, so I think that we should
 accept the program.

 The (new, now merged) `Typeable` solver does exactly what Richard says.

 The instance for `Typeable (f a)` has to be computed from the evidence for
 the types `f` and `a`.  If that was not the case, we'd get some very odd
 behavior depending on how type variables get instantiated.  Now, if `f`
 happened to be a concrete type (e.g., like `V n`), then we can reduce
 further, but if we happen to already have a solution for `V n`, we don't
 have to reduce any further---after all, ''that'' solution must have been
 built by the internal typeable solver in the first place.

 Note that the actual `TypeRep`s are built by always applying the
 constructor to all arguments: see the comment on `mkAppTy` in
 `Data.Typeable.Internal`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10177#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list