lambda :: [String] -> Parser ()
lambda variables =
do
char '('
choice
[ do
string "abs "
name <- manysome $ charBy (`elem` ['a'..'z'])
guard $ notElem name variables
char ' '
lambda (name : variables)
, do
string "var "
choice (map string variables)
return ()
, do
string "app "
lambda variables
char ' '
lambda variables
]
char ')'
return ()
Try it online!Try it online!