byteslice 0.2.5.1 → 0.2.5.2
raw patch · 7 files changed
+35/−14 lines, 7 files
Files
- CHANGELOG.md +5/−1
- byteslice.cabal +7/−2
- src-ghc-cstrlen/Cstrlen.hs +7/−0
- src-no-ghc-cstrlen/Cstrlen.hs +14/−0
- src-no-unlifted-newtypes/UnliftedBytes.hs +1/−8
- src-unlifted-newtypes/UnliftedBytes.hs +0/−2
- src/Data/Bytes.hs +1/−1
CHANGELOG.md view
@@ -1,6 +1,10 @@ # Revision history for byteslice -## 0.2.5.1 -- 2021-02-22+## 0.2.5.2 -- 2021-02-23++* Correct compatibility shims.++## 0.2.5.1 -- 2021-02-22 (deprecated) * Compatibility with GHC 9.0.
byteslice.cabal view
@@ -1,6 +1,6 @@-cabal-version: 2.2+cabal-version: 2.4 name: byteslice-version: 0.2.5.1+version: 0.2.5.2 synopsis: Slicing managed and unmanaged memory description: This library provides types that allow the user to talk about a slice of@@ -32,6 +32,7 @@ Data.Bytes.Pure Data.Bytes.IO UnliftedBytes+ Cstrlen build-depends: , base >=4.11.1 && <5 , bytestring >=0.10.8 && <0.11@@ -48,6 +49,10 @@ else hs-source-dirs: src-no-unlifted-newtypes ghc-options: -fno-warn-dodgy-imports -fno-warn-dodgy-exports+ if impl(ghc>=9.0)+ hs-source-dirs: src-ghc-cstrlen+ else+ hs-source-dirs: src-no-ghc-cstrlen default-language: Haskell2010 include-dirs: include includes: bs_custom.h
+ src-ghc-cstrlen/Cstrlen.hs view
@@ -0,0 +1,7 @@+{-# language MagicHash #-}++module Cstrlen+ ( cstringLength#+ ) where++import GHC.Exts (cstringLength#)
+ src-no-ghc-cstrlen/Cstrlen.hs view
@@ -0,0 +1,14 @@+{-# language MagicHash #-}+{-# language TypeFamilies #-}+{-# language UnliftedFFITypes #-}++module Cstrlen+ ( cstringLength#+ ) where++import GHC.Exts (Addr#,Int#)++foreign import ccall unsafe "strlen" c_strlen :: Addr# -> Int#++cstringLength# :: Addr# -> Int#+cstringLength# = c_strlen
src-no-unlifted-newtypes/UnliftedBytes.hs view
@@ -2,20 +2,13 @@ {-# language TypeFamilies #-} {-# language TypeInType #-} {-# language UndecidableInstances #-}-{-# language UnliftedFFITypes #-} module UnliftedBytes ( Bytes#- , cstringLength# ) where import GHC.TypeLits-import GHC.Exts (Addr#,Int#,RuntimeRep(..),TYPE)+import GHC.Exts (RuntimeRep(..),TYPE) type family Bytes# :: TYPE ('TupleRep '[ 'UnliftedRep,'IntRep,'IntRep]) where Bytes# = TypeError ('Text "Bytes# not available before GHC 8.10")--foreign import ccall unsafe "strlen" c_strlen :: Addr# -> Int#--cstringLength# :: Addr# -> Int#-cstringLength# = c_strlen
src-unlifted-newtypes/UnliftedBytes.hs view
@@ -7,11 +7,9 @@ module UnliftedBytes ( Bytes#(..)- , cstringLength# ) where import GHC.Exts (ByteArray#,Int#,RuntimeRep(..),TYPE)-import GHC.Exts (cstringLength#) newtype Bytes# :: TYPE ('TupleRep '[ 'UnliftedRep,'IntRep,'IntRep]) where Bytes# :: (# ByteArray#, Int#, Int# #) -> Bytes#
src/Data/Bytes.hs view
@@ -151,7 +151,7 @@ import GHC.Exts (Addr#,Word#,Int#) import GHC.IO (unsafeIOToST) import GHC.Word (Word8(W8#))-import UnliftedBytes (cstringLength#)+import Cstrlen (cstringLength#) import qualified Data.ByteString as ByteString import qualified Data.ByteString.Unsafe as ByteString