Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class IsTree t where
- getChildren :: t -> [t]
- data Parser bc t a where
- Pure :: a -> Parser bc t a
- LiftA2 :: (b -> c -> a) -> Parser bc t b -> Parser bc t c -> Parser bc t a
- GetCrumbs :: Parser bc t bc
- Target :: (t -> Bool) -> Parser bc t a -> Parser bc t [a]
- OnChildren :: Parser bc t a -> Parser bc t [a]
- Current :: Parser bc t t
- Expect :: Parser bc t (Maybe a) -> Parser bc t a
- Fail :: Parser bc t a
- mapTree :: (t -> t') -> Parser bc t' a -> Parser bc t a
- data Split bc t a where
- expect :: Parser bc t (Maybe a) -> Parser bc t a
- try :: Parser bc t a -> Parser bc t (Maybe a)
Documentation
Lasercutter supports any inductive tree types, as witnessed by
getChildren
.
Since: 0.1.0.0
getChildren :: t -> [t] Source #
Get all children of the current node.
Since: 0.1.0.0
data Parser bc t a where Source #
A tree parser which runs all queries in a single pass. This is accomplished via a free encoding of the applicative structure, which can be arbitrarily reassociated for better performance.
Since: 0.1.0.0
Pure :: a -> Parser bc t a | The free Since: 0.1.0.0 |
LiftA2 :: (b -> c -> a) -> Parser bc t b -> Parser bc t c -> Parser bc t a | The free Since: 0.1.0.0 |
GetCrumbs :: Parser bc t bc | Get the breadcrumbs at the current part of the tree. Since: 0.1.0.0 |
Target :: (t -> Bool) -> Parser bc t a -> Parser bc t [a] | Run the given parser at every subtree which matches the given predicate. This is not recursive --- that is, a given subtree only runs the given parser once, not in all further matching subtrees. Since: 0.1.0.0 |
OnChildren :: Parser bc t a -> Parser bc t [a] | Run the given parser on each child of the current node. Since: 0.1.0.0 |
Current :: Parser bc t t | Get the current node. Since: 0.1.0.0 |
Expect :: Parser bc t (Maybe a) -> Parser bc t a | Swallow a parsed
Since: 0.1.0.0 |
Fail :: Parser bc t a | Immediately fail a parse. Equivalent to Since: 0.1.0.0 |
Instances
Profunctor (Parser bc) Source # | |
Defined in Lasercutter.Types dimap :: (a -> b) -> (c -> d) -> Parser bc b c -> Parser bc a d # lmap :: (a -> b) -> Parser bc b c -> Parser bc a c # rmap :: (b -> c) -> Parser bc a b -> Parser bc a c # (#.) :: forall a b c q. Coercible c b => q b c -> Parser bc a b -> Parser bc a c # (.#) :: forall a b c q. Coercible b a => Parser bc b c -> q a b -> Parser bc a c # | |
Functor (Parser bc t) Source # | |
Applicative (Parser bc t) Source # | |
Defined in Lasercutter.Types | |
Alternative (Parser bc t) Source # | |
Selective (Parser bc t) Source # | |
Filterable (Parser bc t) Source # | |
Show (Parser bc t a) Source # | |
Semigroup a => Semigroup (Parser bc t a) Source # | |
Monoid a => Monoid (Parser bc t a) Source # | |
mapTree :: (t -> t') -> Parser bc t' a -> Parser bc t a Source #
Transform the type of tree that a Parser
operates over.
Since: 0.1.0.0
data Split bc t a where Source #
A parser to run on children, and a subsequent continuation for how to parse the parent.
Since: 0.1.0.0