[GHC] #10447: DeriveFoldable rejects instances with constraints in last argument of data type

GHC ghc-devs at haskell.org
Wed May 27 02:08:49 UTC 2015


#10447: DeriveFoldable rejects instances with constraints in last argument of data
type
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #8678             |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by ekmett):

 `Foldable` is safe in the presence of any constraint at all on `a`. It
 doesn't ever produce one, just consumes them. All occurrences of `a` in
 the `Foldable` dictionary are in negative position, and it can safely
 ignore any constraints on `a` you put in place.

 `Functor` and `Traversable` need to keep the check, though.

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


More information about the ghc-tickets mailing list