[GHC] #11349: [TypeApplications] Create Proxy-free alternatives of functions in base

GHC ghc-devs at haskell.org
Wed Jan 13 02:43:00 UTC 2016


#11349: [TypeApplications] Create Proxy-free alternatives of functions in base
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  7.10.3
      Resolution:                    |             Keywords:
                                     |  TypeApplications
Operating System:  Other             |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ekmett):

 Using unsigned types for size and having random wraparound issues is a
 huge source of user error in the C++ world, to the point where it is
 arguably a worse problem than dealing with negative values, since there it
 is an easy check. On the other hand using a type with undefined overflow
 once you start dealing with arithmetic and have `x + y - z` situations the
 logic gets rather complicated and very branchy. The number of branches
 involved gets even sillier if that type is actually a `Natural` and it has
 to deal with both small and large code paths behind the scenes. Using
 `Natural` there would turn such code from two assembly operations and an
 optional bounds check to something involving up to 16 cases which can't be
 avoided without getting too clever about it.

 Like it or not `Int` took on the role of sizes in the Haskell community,
 and it pushes the bad corner cases far away from the domain of actual use
 as noted by Reid. I don't see that changing in the foreseeable future. I
 think I'm going to echo Richard's suggestion of doing this "outside
 `base`", but without the positive outlook about it being merged back.

 Switching `KnownNat` to `Natural` and the like is on the agenda, however.

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


More information about the ghc-tickets mailing list