Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Text.StringLike.Matchable
Documentation
class StringLike str => Matchable str where Source #
An extention of string-like types for sub-string matching at various postions.
Minimal complete definition
matchesPrefixOf, matchesInfixOf, matchesSuffixOf, matchesWordOf
Methods
matchesExactly :: str -> str -> Bool Source #
Checks if two strings match exactly. This should by equal to '(==)' for most types.
matchesPrefixOf :: str -> str -> Bool Source #
Checks if the first string is a prefix of of the second. If the first string is empty, the
result is always False
.
matchesInfixOf :: str -> str -> Bool Source #
Checks if the first string is an infix of the second, i.e. if the first string appears
somewhere in the second. If the first string is empty, the result is always False
.
matchesSuffixOf :: str -> str -> Bool Source #
Checks if the first string is a suffix of the second. If the first string is empty, the
result is always False
.
matchesWordOf :: str -> str -> Bool Source #
Checks if the first string matches any of the whitespace-separated substrings in the second
string exactly. If the first string is empty, the result is always False
.