Copyright | ©2020 James Alexander Feldman-Crough |
---|---|
License | MPL-2.0 |
Maintainer | alex@fldcr.com |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type Match i e f a = MatchM i e a f ()
- data MatchM i e a f r
- match :: CanMatch i => Match i e f a -> RuleT i e f a
- break :: RuleT () e f a -> Match Inline e f a
- breakWith :: a -> Match Inline e f a
- blocktag :: Key -> RuleT BlockRegion e f a -> Match Block e f a
- inlinetag :: Key -> RuleT InlineRegion e f a -> Match Inline e f a
- literaltag :: Key -> RuleT LiteralRegion e f a -> Match Block e f a
- paragraph :: RuleT (SeriesNE Inline) e f a -> Match Block e f a
- text :: RuleT Text e f a -> Match Inline e f a
DSL for matching cases
data MatchM i e a f r Source #
A monadic interface for defining fallible patterns. In practice, r
will
always be instantiated to ()
— Match
can be more clear.
Instances
Monad (MatchM i e a f) Source # | |
Functor (MatchM i e a f) Source # | |
Applicative (MatchM i e a f) Source # | |
Defined in Prosidy.Compile.Match pure :: a0 -> MatchM i e a f a0 # (<*>) :: MatchM i e a f (a0 -> b) -> MatchM i e a f a0 -> MatchM i e a f b # liftA2 :: (a0 -> b -> c) -> MatchM i e a f a0 -> MatchM i e a f b -> MatchM i e a f c # (*>) :: MatchM i e a f a0 -> MatchM i e a f b -> MatchM i e a f b # (<*) :: MatchM i e a f a0 -> MatchM i e a f b -> MatchM i e a f a0 # |
match :: CanMatch i => Match i e f a -> RuleT i e f a Source #
Finalize a Match
into a rule. This is often used to offset a match
block:
blocktags :: Match Block Void Identity String blocktags = match $ do ...
Specific matchers
literaltag :: Key -> RuleT LiteralRegion e f a -> Match Block e f a Source #
Match an LiteralTag
with the given Key
.