packages feed

hw-prim 0.3.0.0 → 0.3.0.1

raw patch · 4 files changed

+150/−24 lines, 4 filesdep ~hw-primPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

Dependency ranges changed: hw-prim

API changes (from Hackage documentation)

+ HaskellWorks.Data.Sign: class Sign a where type SignOf a where {
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Int.Int16
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Int.Int32
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Int.Int64
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Int.Int8
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Types.Int
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Types.Word
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Word.Word16
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Word.Word32
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Word.Word64
+ HaskellWorks.Data.Sign: instance HaskellWorks.Data.Sign.Sign GHC.Word.Word8
+ HaskellWorks.Data.Sign: sign :: Sign a => a -> SignOf a
+ HaskellWorks.Data.Sign: type family SignOf a;
+ HaskellWorks.Data.Sign: }
+ HaskellWorks.Data.Unsign: class Unsign a where type UnsignOf a where {
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Int.Int16
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Int.Int32
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Int.Int64
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Int.Int8
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Types.Int
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Types.Word
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Word.Word16
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Word.Word32
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Word.Word64
+ HaskellWorks.Data.Unsign: instance HaskellWorks.Data.Unsign.Unsign GHC.Word.Word8
+ HaskellWorks.Data.Unsign: type family UnsignOf a;
+ HaskellWorks.Data.Unsign: unsign :: Unsign a => a -> UnsignOf a
+ HaskellWorks.Data.Unsign: }

Files

hw-prim.cabal view
@@ -1,5 +1,5 @@ name:                   hw-prim-version:                0.3.0.0+version:                0.3.0.1 synopsis:               Primitive functions and data types description:            Please see README.md homepage:               http://github.com/haskell-works/hw-prim#readme@@ -19,7 +19,7 @@   main-is:              Main.hs   ghc-options:          -threaded -rtsopts -with-rtsopts=-N -Wall -msse4.2   build-depends:        base                          >= 4          && < 5-                      , hw-prim+                      , hw-prim                       >= 0.3.0.0   default-language:     Haskell2010  library@@ -44,10 +44,12 @@                       , HaskellWorks.Data.Narrow.Narrow64                       , HaskellWorks.Data.Positioning                       , HaskellWorks.Data.Search+                      , HaskellWorks.Data.Sign                       , HaskellWorks.Data.Snoc                       , HaskellWorks.Data.Take                       , HaskellWorks.Data.TreeCursor                       , HaskellWorks.Data.Uncons+                      , HaskellWorks.Data.Unsign                       , HaskellWorks.Data.Vector.BoxedVectorLike                       , HaskellWorks.Data.Vector.StorableVectorLike                       , HaskellWorks.Data.Widen@@ -72,7 +74,7 @@   build-depends:        base                          >= 4          && < 5                       , bytestring                       , hspec-                      , hw-prim+                      , hw-prim                       >= 0.3.0.0                       , QuickCheck                       , random                       , vector@@ -91,5 +93,5 @@     Default-Language: Haskell2010     Build-Depends:      base                          >= 4          && < 5                       , criterion-                      , hw-prim+                      , hw-prim                       >= 0.3.0.0                       , vector
src/HaskellWorks/Data/AtIndex.hs view
@@ -17,119 +17,119 @@ import           HaskellWorks.Data.Positioning  class Length v => AtIndex v where-  (!!!) :: v -> Position -> Elem v+  (!!!)   :: v -> Position -> Elem v   atIndex :: v -> Position -> Elem v  instance AtIndex [a] where-  (!!!) v i = v !! fromIntegral i+  (!!!)   v i = v !! fromIntegral i   atIndex v i = v !! fromIntegral i   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex BS.ByteString where-  (!!!) v i = v `BS.index` fromIntegral i+  (!!!)   v i = v `BS.index` fromIntegral i   atIndex v i = BS.index v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Word8) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Word16) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Word32) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Word64) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Word8) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Word16) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Word32) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Word64) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Int8) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Int16) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Int32) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DV.Vector Int64) where-  (!!!) v i = v DV.! fromIntegral i+  (!!!)   v i = v DV.! fromIntegral i   atIndex v i = DV.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Int8) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Int16) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Int32) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Int64) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}  instance AtIndex (DVS.Vector Int) where-  (!!!) v i = v DVS.! fromIntegral i+  (!!!)   v i = v DVS.! fromIntegral i   atIndex v i = DVS.unsafeIndex v (fromIntegral i)   {-# INLINE (!!!)   #-}   {-# INLINE atIndex #-}
+ src/HaskellWorks/Data/Sign.hs view
@@ -0,0 +1,62 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Sign+    ( Sign(..)+    ) where++import Data.Int+import Data.Word++class Sign a where+  type SignOf a+  sign :: a -> SignOf a++instance Sign Word where+  type SignOf Word = Int+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Word8 where+  type SignOf Word8 = Int8+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Word16 where+  type SignOf Word16 = Int16+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Word32 where+  type SignOf Word32 = Int32+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Word64 where+  type SignOf Word64 = Int64+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Int where+  type SignOf Int = Int+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Int8 where+  type SignOf Int8 = Int8+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Int16 where+  type SignOf Int16 = Int16+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Int32 where+  type SignOf Int32 = Int32+  sign = fromIntegral+  {-# INLINE sign #-}++instance Sign Int64 where+  type SignOf Int64 = Int64+  sign = fromIntegral+  {-# INLINE sign #-}
+ src/HaskellWorks/Data/Unsign.hs view
@@ -0,0 +1,62 @@+{-# LANGUAGE TypeFamilies #-}++module HaskellWorks.Data.Unsign+    ( Unsign(..)+    ) where++import Data.Int+import Data.Word++class Unsign a where+  type UnsignOf a+  unsign :: a -> UnsignOf a++instance Unsign Int where+  type UnsignOf Int = Word+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Int8 where+  type UnsignOf Int8 = Word8+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Int16 where+  type UnsignOf Int16 = Word16+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Int32 where+  type UnsignOf Int32 = Word32+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Int64 where+  type UnsignOf Int64 = Word64+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Word where+  type UnsignOf Word = Word+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Word8 where+  type UnsignOf Word8 = Word8+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Word16 where+  type UnsignOf Word16 = Word16+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Word32 where+  type UnsignOf Word32 = Word32+  unsign = fromIntegral+  {-# INLINE unsign #-}++instance Unsign Word64 where+  type UnsignOf Word64 = Word64+  unsign = fromIntegral+  {-# INLINE unsign #-}