[GHC] #14004: G

GHC ghc-devs at haskell.org
Sun Jul 23 13:23:20 UTC 2017


#14004: G
-------------------------------------+-------------------------------------
        Reporter:  zaoqi             |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
      Resolution:                    |             Keywords:
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 AntC):

 Replying to [comment:12 zaoqi]:
 > Replying to [comment:11 AntC]:
 > >
 > > So `instance Eq Dyn` will always return False.
 >
 > How to write the correct `instance Eq Dyn`, do not change `data Dyn`.

 The short answer is: `data Dyn` has the wrong definition for looking
 inside. Ben has given you one possibility in comment:8. A more simple one
 is:

 {{{

 data Dyn a where
     Dyn :: Eq a => a -> Dyn a

 }}}

 If you can't change the definition of `Dyn` (why not?), you need to
 explain what you are trying to achieve.

 I suggest you ask a question on the cafe (or StackOverflow). GHC is
 behaving as intended. There's no fault, so Trac is not the place to look
 for that kind of help.

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


More information about the ghc-tickets mailing list