Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Tag = Tag {}
- data TagPattern
- newtype TagNode = TagNode {}
- constructTag :: NonEmpty TagNode -> Tag
- deconstructTag :: HasCallStack => Tag -> NonEmpty TagNode
- tagTree :: (Eq a, Default a) => Map Tag a -> Forest (TagNode, a)
- mkTagPattern :: Text -> TagPattern
- mkTagPatternFromTag :: Tag -> TagPattern
- tagMatch :: TagPattern -> Tag -> Bool
- foldTagTree :: (Eq a, Default a) => Forest (TagNode, a) -> Forest (NonEmpty TagNode, a)
Types
A hierarchical tag
Tag nodes are separated by /
data TagPattern Source #
A glob-based pattern to match hierarchical tags
For example, the pattern
foo/**
matches both the following
foo/bar/baz foo/baz
Instances
An individual component of a hierarchical tag
The following hierarchical tag,
foo/bar/baz
has three tag nodes: foo
, bar
and baz
Create Tags
deconstructTag :: HasCallStack => Tag -> NonEmpty TagNode Source #
Creating Tag Trees
tagTree :: (Eq a, Default a) => Map Tag a -> Forest (TagNode, a) Source #
Construct the tree from a list of hierarchical tags
Searching Tags
mkTagPattern :: Text -> TagPattern Source #
mkTagPatternFromTag :: Tag -> TagPattern Source #