There is a single exposed function,
eval : Dict String String -> String -> String
The first argument is a dictionary which defined rewrite rules, e.g.,
Dict.fromList
[
("true", "\\x.\\y.x")
"false", "\\x.\\y.y")
"and", "\\p.\\q.p q p")
"or", "\\p.\\q.p p q"
"not", "\\p.p (\\x.\\y.y) (\\x.\\y.x)"
]
Strings on the left are to be rewritten as strings on the right. Those on the right should be lambda tersm.
The eval function parses the given string, rewrites it as needed, applies beta reduction, and then turns this final expression back into a string.
eval : Dict String String -> String -> String