Copyright | (c) Galois Inc 2019-2020 |
---|---|
License | BSD3 |
Maintainer | Rob Dockins <rdockins@galois.com> |
Stability | provisional |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
What4.Utils.StringLiteral
Description
Synopsis
- data StringLiteral (si :: StringInfo) :: Type where
- stringLiteralInfo :: StringLiteral si -> StringInfoRepr si
- fromUnicodeLit :: StringLiteral Unicode -> Text
- fromChar8Lit :: StringLiteral Char8 -> ByteString
- fromChar16Lit :: StringLiteral Char16 -> Word16String
- stringLitEmpty :: StringInfoRepr si -> StringLiteral si
- stringLitLength :: StringLiteral si -> Integer
- stringLitNull :: StringLiteral si -> Bool
- stringLitBounds :: StringLiteral si -> Maybe (Int, Int)
- stringLitContains :: StringLiteral si -> StringLiteral si -> Bool
- stringLitIsPrefixOf :: StringLiteral si -> StringLiteral si -> Bool
- stringLitIsSuffixOf :: StringLiteral si -> StringLiteral si -> Bool
- stringLitSubstring :: StringLiteral si -> Integer -> Integer -> StringLiteral si
- stringLitIndexOf :: StringLiteral si -> StringLiteral si -> Integer -> Integer
Documentation
data StringLiteral (si :: StringInfo) :: Type where Source #
Constructors
UnicodeLiteral :: !Text -> StringLiteral Unicode | |
Char8Literal :: !ByteString -> StringLiteral Char8 | |
Char16Literal :: !Word16String -> StringLiteral Char16 |
Instances
stringLiteralInfo :: StringLiteral si -> StringInfoRepr si Source #
stringLitEmpty :: StringInfoRepr si -> StringLiteral si Source #
stringLitLength :: StringLiteral si -> Integer Source #
stringLitNull :: StringLiteral si -> Bool Source #
stringLitBounds :: StringLiteral si -> Maybe (Int, Int) Source #
stringLitContains :: StringLiteral si -> StringLiteral si -> Bool Source #
stringLitIsPrefixOf :: StringLiteral si -> StringLiteral si -> Bool Source #
stringLitIsSuffixOf :: StringLiteral si -> StringLiteral si -> Bool Source #
stringLitSubstring :: StringLiteral si -> Integer -> Integer -> StringLiteral si Source #
stringLitIndexOf :: StringLiteral si -> StringLiteral si -> Integer -> Integer Source #
Index of first occurrence of second string in first one starting at
the position specified by the third argument.
stringLitIndexOf s t k
, with 0 <= k <= |s|
is the position of the first
occurrence of t
in s
at or after position k
, if any.
Otherwise, it is -1
. Note that the result is k
whenever k
is within
the range [0, |s|]
and t
is empty.