match -package:pcre-light

Use with caseE
Return both the result of a parse and the portion of the input that was consumed while it was being parsed.
Return both the result of a parse and the portion of the input that was consumed while it was being parsed.
Decompose a Graph into the MContext found for the given node and the remaining Graph.
Does the key i match the prefix p (up to but not including bit m)?
Return both the result of a parse and a chunk of input that was consumed during parsing. This relies on the change of the stateOffset value to evaluate how many tokens were consumed. If you mess with it manually in the argument parser, prepare for troubles.
Matches the given Pattern against the given FilePath, returning True if the pattern matches and False otherwise.
Type of matching to use, if any
Pattern match on a CoRec by specifying handlers for each case. Note that the order of the Handlers has to match the type level list (t:ts).
>>> :{
let testCoRec = Col (Identity False) :: CoRec Identity [Int, String, Bool] in
match testCoRec $
(H $ \i -> "my Int is the successor of " ++ show (i - 1))
:& (H $ \s -> "my String is: " ++ s)
:& (H $ \b -> "my Bool is not: " ++ show (not b) ++ " thus it is " ++ show b)
:& RNil
:}
"my Bool is not: True thus it is False"
"Pattern match" on a Context
match (insert k v ctx) = Just (k, v, ctx)
match  empty           = Nothing
Match a Pattern against a Text input, returning all possible solutions The Pattern must match the entire Text
Match against any message of the right type
Add a selection of which source files to process (using the given glob pattern) to the given remaining Rules value. The expanded, relative path of the matched source file on disk (relative to the project directory configured with providerDirectory) becomes the identifier under which the compilation result is saved to the Store (in case you want to load it within another rule). See Identifier for details.

Examples

Select all markdown files within a directory (but without subdirectories)
-- Match all Markdown files in the immediate 'posts' directory
-- e.g. '<project-directory>/posts/hakyll.md'
-- but NOT  '<project-directory>/posts/haskell/monad.md'
match "posts/*.md" $ do
route $ setExtension "html"
compile pandocCompiler
Select all markdown files within a directory (including subdirectories recursively)
-- Match all Markdown files in the 'posts' directory and any subdirectory
-- e.g. '<project-directory>/posts/hakyll.md'
-- and  '<project-directory>/posts/haskell/monad.md'
match "posts/**.md" $ do
route $ setExtension "html"
compile pandocCompiler
See Pattern or search "glob patterns" online for more details. To control where the compilation result will be written out, use routing functions like setExtension.
Attempt to match a string of symbols against the regular expression. Note that the whole string (not just some part of it) should be matched. Examples:
Text.Regex.Applicative> match (sym 'a' <|> sym 'b') "a"
Just 'a'
Text.Regex.Applicative> match (sym 'a' <|> sym 'b') "ab"
Nothing
Given a query, find the longest prefix with an associated value in the trie, and return that prefix, its value, and the remainder of the query.
Like ?==, but returns Nothing on if there is no match, otherwise Just with the list of fragments matching each wildcard. For example:
isJust (match p x) == (p ?== x)
match "**/*.c" "test.txt" == Nothing
match "**/*.c" "foo.c" == Just ["","foo"]
match "**/*.c" "bar/baz/foo.c" == Just ["bar/baz/","foo"]
On Windows any \ path separators will be replaced by /.
General function to create bidirectional converters for key-value pairs. In order to use this function you need to create TomlBiMap for your type and AnyValue:
_MyType :: TomlBiMap MyType AnyValue
And then you can create codec for your type using match function:
myType :: Key -> TomlCodec MyType
myType = match _MyType
Generic implementation of PatternMatch construction.
match s r checks whether s is in the language generated by r.