[GHC] #11028: Refactor ConDecl

GHC ghc-devs at haskell.org
Mon Nov 23 10:17:53 UTC 2015


#11028: Refactor ConDecl
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      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 jstolarek):

 Replying to simonpj:
 > The `con_old_rec` is a warning thing for GADTs (see current source code)

 Incidentally, I removed that field not so long ago - see
 ea8c116ac9eb916fdb6360a01c285bc8698dfaf9.

 {{{#!hs
 data ConDecl name
   | ConDeclGADT
       { con_names   :: [Located name]
       , con_type    :: LHsSigType name  -- The type after the ‘::’
       , con_doc     :: Maybe LHsDocString
       , con_old_rec :: Bool }
 }}}

 What is `LHsSigType`? A synonym for `LHsType`? If so then, perhaps it
 would be a good idea to have separate fields for storing foralls and the
 context? I'm looking at my work on #10828 (Phab:D1465) and I think the
 implementation in `DsMeta` would get a bit more difficult if foralls and
 context are folded into one field with the whole type.  Of course we can
 create functions that extract these information from `ConDecl` but
 wouldn't separate fields be easier?

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


More information about the ghc-tickets mailing list