primitive-unaligned 0.1.1.0 → 0.1.1.1
raw patch · 2 files changed
+17/−7 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Primitive.ByteArray.Unaligned: instance Data.Primitive.ByteArray.Unaligned.PrimUnaligned System.Posix.Types.CCc
- Data.Primitive.ByteArray.Unaligned: instance Data.Primitive.ByteArray.Unaligned.PrimUnaligned System.Posix.Types.CGid
- Data.Primitive.ByteArray.Unaligned: instance Data.Primitive.ByteArray.Unaligned.PrimUnaligned System.Posix.Types.CNlink
- Data.Primitive.ByteArray.Unaligned: instance Data.Primitive.ByteArray.Unaligned.PrimUnaligned System.Posix.Types.CUid
Files
primitive-unaligned.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: primitive-unaligned-version: 0.1.1.0+version: 0.1.1.1 synopsis: Unaligned access to primitive arrays description: Unaligned access to primitive arrays. The offsets are given in bytes rather than elements. homepage: https://github.com/haskell-primitive/primitive-unaligned
src/Data/Primitive/ByteArray/Unaligned.hs view
@@ -5,6 +5,7 @@ {-# language GeneralizedNewtypeDeriving #-} {-# language PolyKinds #-} {-# language DataKinds #-}+{-# language CPP #-} module Data.Primitive.ByteArray.Unaligned ( -- * Class@@ -36,14 +37,14 @@ -- of the typeclass methods are interpreted as bytes, -- not elements. class PrimUnaligned a where- indexUnalignedByteArray# :: + indexUnalignedByteArray# :: ByteArray# -> Int# -> a- readUnalignedByteArray# :: + readUnalignedByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, a #)- writeUnalignedByteArray# :: + writeUnalignedByteArray# :: MutableByteArray# s -> Int# -> a@@ -196,17 +197,27 @@ writeUnalignedByteArray# a i (Ptr w) = E.writeWord8ArrayAsAddr# a i w +#if defined(HTYPE_CC_T) deriving newtype instance PrimUnaligned P.CCc+#endif+#if defined(HTYPE_GID_T)+deriving newtype instance PrimUnaligned P.CGid+#endif+#if defined(HTYPE_NLINK_T)+deriving newtype instance PrimUnaligned P.CNlink+#endif+#if defined(HTYPE_UID_T)+deriving newtype instance PrimUnaligned P.CUid+#endif+ deriving newtype instance PrimUnaligned C.CChar deriving newtype instance PrimUnaligned P.CDev deriving newtype instance PrimUnaligned C.CDouble-deriving newtype instance PrimUnaligned P.CGid deriving newtype instance PrimUnaligned P.CIno deriving newtype instance PrimUnaligned C.CInt deriving newtype instance PrimUnaligned C.CLLong deriving newtype instance PrimUnaligned C.CLong deriving newtype instance PrimUnaligned P.CMode-deriving newtype instance PrimUnaligned P.CNlink deriving newtype instance PrimUnaligned P.COff deriving newtype instance PrimUnaligned P.CPid deriving newtype instance PrimUnaligned C.CSChar@@ -215,7 +226,6 @@ deriving newtype instance PrimUnaligned C.CUInt deriving newtype instance PrimUnaligned C.CULLong deriving newtype instance PrimUnaligned C.CULong-deriving newtype instance PrimUnaligned P.CUid deriving newtype instance PrimUnaligned P.Fd -- | Read a primitive value from the byte array.