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" ]
]
This is the type of the parser syntax tree.
parse : String -> Result String QueryTerm