[GHC] #8782: Using GADT's to maintain invariant in GHC libraries

GHC ghc-devs at haskell.org
Thu Feb 13 13:32:02 UTC 2014


#8782: Using GADT's to maintain invariant in GHC libraries
------------------------------------+-------------------------------------
       Reporter:  Iceland_jack      |             Owner:
           Type:  task              |            Status:  new
       Priority:  lowest            |         Milestone:
      Component:  Compiler          |           Version:  7.9
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 I rewrote `compiler/utils/OrdList.lhs` using a GADT to preserve some
 invariants stated only in comments — an excellent chance for `ghc` to eat
 its own proverbial dog food I feel :)

 The type signatures remain the same so it should be a drop-in replacement
 but it does use some GHC features that are too recent (closed type
 families in particular, the `IsList` instance can be removed) making it
 ineligible for inclusion I believe.

 hvr on `#ghc` suggested that I submit a patch anyway and that it could be
 implemented at a later date (they said `ghc` must be able to be compiled
 by the last two previous major versions), if this is useful then I will
 translate `Bag.hls` which has the same invariants but more complicated
 functions.

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


More information about the ghc-tickets mailing list