In "good1.fun", the line
main = fst (twice (\x -> x)) 6 7
is found. Let's call "(twice (\x -> x))" A, "6" B and "7" C.
Then the correct parsing of this line would be
main = (fst(A,B)) C
but our grammar parses this as
main = (fst(A,B,C))
"Ident [Exp]" in our grammar can't know about how many arguments "fst"
should take,
does anyone have any advice to give about how to parse Applications ?
Exp ::= Exp Exp
where Exp should be some ExpN where N is the right precedence level.
Every expression could be applied to every other expression. For
instance your grammar doesn't support expression like:
(\x -> x) 0
After you have the grammar then the interpreter should take care of
how many arguments are passed to the function.