Modules 11
System.OsString.Data.ByteString.Short.Internal
experimentalInternal low-level utilities mostly for Word16,
such as byte-array operations and other stuff not meant to be exported from Word16 module.
isSpace :: Word16 -> Bool
word16ToChar :: Word16 -> Char
Total conversion to char.
create :: Int -> (forall s. MBA s -> ST s ()) -> ShortByteString
asBA :: ShortByteString -> BA
data BA
BA# :: ByteArray# -> BA
data MBA s
MBA# :: (MutableByteArray# s) -> MBA s
newPinnedByteArray :: Int -> ST s (MBA s)
newByteArray :: Int -> ST s (MBA s)
copyByteArray :: BA -> Int -> MBA s -> Int -> Int -> ST s ()
unsafeFreezeByteArray :: MBA s -> ST s BA
copyAddrToByteArray :: Ptr a -> MBA RealWorld -> Int -> Int -> ST RealWorld ()
packCWString :: Ptr Word16 -> IO ShortByteString
O(n). Construct a new ShortByteString from a CWString. The
resulting ShortByteString is an immutable copy of the original
CWString, and is managed on the Haskell heap. The original
CWString must be null terminated.
packCWStringLen :: (Ptr Word16, Int) -> IO ShortByteString
O(n). Construct a new ShortByteString from a CWStringLen. The
resulting ShortByteString is an immutable copy of the original CWStringLen.
The ShortByteString is a normal Haskell value and will be managed on the
Haskell heap.
useAsCWString :: ShortByteString -> (Ptr Word16 -> IO a) -> IO a
O(n) construction. Use a ShortByteString with a function requiring a
null-terminated CWString. The CWString is a copy and will be freed
automatically; it must not be stored or used after the
subcomputation finishes.
useAsCWStringLen :: ShortByteString -> ((Ptr Word16, Int) -> IO a) -> IO a
O(n) construction. Use a ShortByteString with a function requiring a CWStringLen.
As for useAsCWString this function makes a copy of the original ShortByteString.
It must not be stored or used after the subcomputation finishes.
newCWString :: ShortByteString -> IO (Ptr Word16)
O(n) construction. Use a ShortByteString with a function requiring a CWStringLen.
As for useAsCWString this function makes a copy of the original ShortByteString.
It must not be stored or used after the subcomputation finishes.
moduleErrorIO :: String -> String -> IO a
moduleErrorMsg :: String -> String -> String
packWord16 :: [Word16] -> ShortByteString
packLenWord16 :: Int -> [Word16] -> ShortByteString
unpackWord16 :: ShortByteString -> [Word16]
packWord16Rev :: [Word16] -> ShortByteString
packLenWord16Rev :: Int -> [Word16] -> ShortByteString
writeWord16Array :: MBA s -> Int -> Word16 -> ST s ()
Encode Word16 as little-endian.
IntWord8 index (not Word16)
indexWord8Array :: BA -> Int -> Word8
IntWord8 index
indexWord16Array :: BA -> Int -> Word16
Decode Word16 from little-endian.
IntWord8 index (not Word16)
word16ToLE# :: Word16# -> Word16#
word16FromLE# :: Word16# -> Word16#
setByteArray :: MBA s -> Int -> Int -> Int -> ST s ()
copyMutableByteArray :: MBA s -> Int -> MBA s -> Int -> Int -> ST s ()
createAndTrim :: Int -> (forall s. MBA s -> ST s (Int, a)) -> (ShortByteString, a)
Given the maximum size needed and a function to make the contents
of a ShortByteString, createAndTrim makes the ShortByteString.
The generating function is required to return the actual final size
(<= the maximum size) and the result value. The resulting byte array
is realloced to this size.
createAndTrim' :: Int -> (forall s. MBA s -> ST s Int) -> ShortByteString
createAndTrim'' :: Int -> (forall s. MBA s -> MBA s -> ST s (Int, Int)) -> (ShortByteString, ShortByteString)
findIndexOrLength :: (Word16 -> Bool) -> ShortByteString -> Int
findFromEndUntil :: (Word16 -> Bool) -> ShortByteString -> Int
Returns the length of the substring matching, not the index. If no match, returns 0.
assertEven :: ShortByteString -> ShortByteString
errorEmptySBS :: HasCallStack => String -> a
moduleError :: HasCallStack => String -> String -> a
compareByteArraysOff :: BA -> Int -> BA -> Int -> Int -> Int
BAarray 1
Intoffset for array 1
BAarray 2
Intoffset for array 2
Intlength to compare
Intlike memcmp
- Maintainer
- Julian Ospald <hasufell@posteo.de>
- Portability
- portable
- Copyright
- © 2022 Julian Ospald
- License
- MIT
Build record and source files
Community contribution. The service has not verified this documentation. The generator reported 4 diagnostics.
Target: Linux on x86-64. Some inferred types and resolved links are not available.
Generator: aihc-haddock-858b1951-web-1
Metadata snapshot: 467adfa4e90b59b0072712e32d97437632176e89f16e62151dd53a2e41646abb
Open the dependency plan · Download the documentation model
- aihc-base-4.21.2.0 · Core library · Cabal file
- aihc-internal-9.1204.0 · Core library · Cabal file
- aihc-prim-0.13.0 · Core library · Cabal file
- aihc-rts-1.0.2 · Core library · Cabal file
- aihc-template-haskell-2.23.0.0 · Core library · Cabal file
- array-0.5.8.0 · Cabal revision 2 · Cabal file · Source archive
- bytestring-0.12.2.0 · Cabal revision 1 · Cabal file · Source archive
- deepseq-1.5.2.0 · Cabal revision 0 · Cabal file · Source archive
- exceptions-0.10.12 · Cabal revision 2 · Cabal file · Source archive
- mtl-2.3.2 · Cabal revision 1 · Cabal file · Source archive
- os-string-2.0.11 · Cabal revision 0 · Cabal file · Source archive
- stm-2.5.3.1 · Cabal revision 1 · Cabal file · Source archive
- transformers-0.6.3.0 · Cabal revision 2 · Cabal file · Source archive