fix bug caused by incomplete pattern in precedence function

typing in a string like "4 + sqrt(5)" would cause a crash
because in the middle of typing "sqrt" the evaluator would
treat 's' as an operator and try to compare it's precedence
to the precedence of '+'. The precedence function did not
match all patterns and this adds an otherwise case.
This commit is contained in:
adamrk
2017-05-29 00:20:40 -04:00
parent 6744136708
commit a7a06a7684

View File

@@ -103,6 +103,7 @@ precedence "<=" = 2
precedence ">=" = 2
precedence "==" = 2
precedence "!=" = 2
precedence _ = 6
contains :: Eq a => [a] -> a -> Bool