Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Pos = Pos {}
- endPos :: Pos
- addrToPos# :: Addr# -> Addr# -> Pos
- posToAddr# :: Addr# -> Pos -> Addr#
- data Span = Span !Pos !Pos
- unsafeSlice :: ByteString -> Span -> ByteString
Documentation
Byte offset counted backwards from the end of the buffer.
Note: the Ord
instance for Pos
considers the earlier positions to be
smaller.
addrToPos# :: Addr# -> Addr# -> Pos Source #
Very unsafe conversion between a primitive address and a position. The first argument points to the end of the buffer, the second argument is being converted.
posToAddr# :: Addr# -> Pos -> Addr# Source #
Very unsafe conversion between a primitive address and a position. The first argument points to the end of the buffer.
A pair of positions.
unsafeSlice :: ByteString -> Span -> ByteString Source #
Slice into a ByteString
using a Span
. The result is invalid if the Span
is not a valid slice of the first argument.