[commit: packages/primitive] master: Comparison primops return Int# (Fixes #6135) (c6b1e20)

git at git.haskell.org git at git.haskell.org
Wed Aug 14 17:17:10 CEST 2013


Repository : ssh://git@git.haskell.org/primitive

On branch  : master
Link       : http://git.haskell.org/?p=packages/primitive.git;a=commit;h=c6b1e204f0f2a1a0d6cb1df35fa60762b2fe3cdc

>---------------------------------------------------------------

commit c6b1e204f0f2a1a0d6cb1df35fa60762b2fe3cdc
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date:   Fri Apr 19 08:33:33 2013 +0200

    Comparison primops return Int# (Fixes #6135)
    
    For a deatiled discussion of this changes please visit the wiki page:
    http://hackage.haskell.org/trac/ghc/wiki/PrimBool


>---------------------------------------------------------------

c6b1e204f0f2a1a0d6cb1df35fa60762b2fe3cdc
 Data/Primitive/Array.hs     |    2 +-
 Data/Primitive/ByteArray.hs |    2 +-
 Data/Primitive/Types.hs     |    1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Data/Primitive/Array.hs b/Data/Primitive/Array.hs
index a5b1f9f..cd94a4a 100644
--- a/Data/Primitive/Array.hs
+++ b/Data/Primitive/Array.hs
@@ -106,7 +106,7 @@ unsafeThawArray (Array arr#)
 sameMutableArray :: MutableArray s a -> MutableArray s a -> Bool
 {-# INLINE sameMutableArray #-}
 sameMutableArray (MutableArray arr#) (MutableArray brr#)
-  = sameMutableArray# arr# brr#
+  = tagToEnum# (sameMutableArray# arr# brr#)
 
 -- | Copy a slice of an immutable array to a mutable array.
 copyArray :: PrimMonad m
diff --git a/Data/Primitive/ByteArray.hs b/Data/Primitive/ByteArray.hs
index a7ba137..097164c 100644
--- a/Data/Primitive/ByteArray.hs
+++ b/Data/Primitive/ByteArray.hs
@@ -88,7 +88,7 @@ mutableByteArrayContents (MutableByteArray arr#)
 sameMutableByteArray :: MutableByteArray s -> MutableByteArray s -> Bool
 {-# INLINE sameMutableByteArray #-}
 sameMutableByteArray (MutableByteArray arr#) (MutableByteArray brr#)
-  = sameMutableByteArray# arr# brr#
+  = tagToEnum# (sameMutableByteArray# arr# brr#)
 
 -- | Convert a mutable byte array to an immutable one without copying. The
 -- array should not be modified after the conversion.
diff --git a/Data/Primitive/Types.hs b/Data/Primitive/Types.hs
index 3206878..04fa5c1 100644
--- a/Data/Primitive/Types.hs
+++ b/Data/Primitive/Types.hs
@@ -34,6 +34,7 @@ import GHC.Int (
   )
 
 import GHC.Prim
+import GHC.PrimWrappers
 
 import Data.Typeable ( Typeable )
 import Data.Data ( Data(..) )





More information about the ghc-commits mailing list