[GHC] #9505: Bounded instance for Word (and possibly others) uses explicitly unboxed literals

GHC ghc-devs at haskell.org
Wed Jul 1 18:22:02 UTC 2015


#9505: Bounded instance for Word (and possibly others) uses explicitly unboxed
literals
-------------------------------------+-------------------------------------
        Reporter:  schyler           |                   Owner:  ekmett
            Type:  task              |                  Status:  new
        Priority:  lowest            |               Milestone:  ⊥
       Component:  Core Libraries    |                 Version:  7.8.2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by thomie):

 In `libraries/base/GHC/Base.hs`:
 {{{#!haskell
 maxInt, minInt :: Int

 {- Seems clumsy. Should perhaps put minInt and MaxInt directly into
 MachDeps.h -}
 #if WORD_SIZE_IN_BITS == 31
 minInt  = I# (-0x40000000#)
 maxInt  = I# 0x3FFFFFFF#
 #elif WORD_SIZE_IN_BITS == 32
 minInt  = I# (-0x80000000#)
 maxInt  = I# 0x7FFFFFFF#
 #else
 minInt  = I# (-0x8000000000000000#)
 maxInt  = I# 0x7FFFFFFFFFFFFFFF#
 #endif
 }}}

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


More information about the ghc-tickets mailing list