jxxcarlson/elm-text-search/2.0.0

Text.Parse

The parse function accepts a query string and if successful produces a value of type Ok QueryTerm. If it is unsuccessful, it returns Err "ill-formed query". For example, the query string "foo -bar | x y" yields the QueryTerm

Disjunction
    [ Conjunction [ Word "foo", NotWord "bar" ]
    , Conjunction [ Word "x", Word "y" ]
    ]
= Word String
| NotWord String
| Conjunction (List QueryTerm)
| Disjunction (List QueryTerm)

This is the type of the parser syntax tree.

parse : String -> Result String QueryTerm