Changes between Version 29 and Version 30 of PrimBool


Ignore:
Timestamp:
Aug 23, 2013 10:29:36 AM (8 months ago)
Author:
jstolarek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PrimBool

    v29 v30  
    9292  * as a small side-task, four new logical bitwise primops have been implemented: `andI#`, `orI#`, `xorI#` and `negI#` (#7689). These operate on values of type `Int#`. Earlier we had only bitwise logical primops operating on values of type `Word#`. 
    9393  * names of the existing comparison primops were changed. Operators had `$` added before `#`, others had `I` added before the `#` (this is a mnemonic denoting that this primop returns and `Int#`). Examples: 
    94  
    9594{{{ 
    9695>=$#      :: Int#    -> Int#    -> Int# 
     
    104103 
    105104  * built in `GHC.Prim` modules was renamed to `GHC.Prim.BuiltIn`. In `ghc-prim` we added a module `GHC.Prim` which re-exports all definitions from `GHC.Prim.BuiltIn` but also adds wrappers for new comparison primops. These wrappers have names identical to removed primops and return a `Bool`. Examples: 
    106  
    107105{{{ 
    108106gtChar# :: Char# -> Char# -> Bool 
     
    126124sameMutableArray# :: MutableArray# s a -> MutableArray# s a -> Int# 
    127125sameMutableArray# a b = tagToEnum# (a `sameMutableArrayI#` b) 
    128 }}} 
    129  
    130 Thanks to renaming of previously existing `GHC.Prim` module and adding wrappers in new `GHC.Prim` module '''the whole change of primops is backwards compatible'''. 
     126}}}  
     127   Thanks to renaming of previously existing `GHC.Prim` module and adding wrappers in new `GHC.Prim` module '''the whole change of primops is backwards compatible'''. 
    131128 
    132129  * functions for comparing `Integer` type, implemented in `integer-gmp` and `integer-simple` libraries, received a similar treatment. Technically they are not primops, because they are implemented in Haskell (in case of `integer-gmp` also with FFI), but they pretend to be ones. There are six primops for comparing `Integer` values: 
     
    139136geInteger#  :: Integer -> Integer -> Int# 
    140137}}} 
    141 Each of these functions has a wrapper that calls `tagToEnum#` and returns a `Bool`. These wrappers are: `eqInteger`, `neqInteger`, `leInteger`, `ltInteger`, `gtInteger` and `geInteger`. 
     138   Each of these functions has a wrapper that calls `tagToEnum#` and returns a `Bool`. These wrappers are: `eqInteger`, `neqInteger`, `leInteger`, `ltInteger`, `gtInteger` and `geInteger`. 
    142139 
    143140  * This change also required some small adjustments in `base` package.