A set of needles with associated values, and an Aho-Corasick automaton to efficiently find those needles.
INVARIANT: searcherAutomaton = Aho.build . searcherNeedles To enforce this invariant, the fields are not exposed from this module. There is a separate constructor function.
The purpose of this wrapper is to have a type that is Hashable and Eq, so we can derive those for types that embed the searcher, whithout requiring the automaton itself to be Hashable or Eq, which would be both wasteful and tedious. Because the automaton is fully determined by the needles and associated values, it is sufficient to implement Eq and Hashable in terms of the needles only.
We also use Hashed to cache the hash of the needles.
Instances9Eq, Show, Generic, Semigroup, NFData, Hashable, …
Eq v => Eq (Searcher v)Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.SearcherShow (Searcher v)Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.SearcherGeneric (Searcher v)Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.SearcherSemigroup (Searcher ())Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.SearcherNFData v => NFData (Searcher v)Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.SearcherHashable v => Hashable (Searcher v)Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.Searcher(Hashable v, FromJSON v) => FromJSON (Searcher v)Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.SearcherToJSON v => ToJSON (Searcher v)Defined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.Searchertype Rep (Searcher v) = D1 ('MetaDataDefined in alfred-margaret-2.1.1.1 · Data.Text.AhoCorasick.Searcher"Searcher"
"Data.Text.AhoCorasick.Searcher"
"alfred-margaret-2.1.1.1-LmqCjvAcVEl7fSX12XT7qq"
'False) (C1 ('MetaCons"Searcher"
'PrefixI 'True) ((S1 ('MetaSel ('Just"searcherCaseSensitive"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CaseSensitivity) :*: S1 ('MetaSel ('Just"searcherNeedles"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Hashed [(Text, v)]))) :*: (S1 ('MetaSel ('Just"searcherNumNeedles"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just"searcherAutomaton"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AcMachine v)))))