reset password
Author Message
rabbott
Posts: 1649
Posted 19:22 Apr 17, 2019 |

In class, Soo asked if the parser could deal with decimal numbers as well as integers. I said it could, but that was wrong.

Line 13 of the DataDeclrs.hs defines an Elmt as Nbr Int as well as a number of other possibilities. So the only number type that can be recognized is Int.

A float generates a parse error.

> evalArith "3.1-2-5^2^2"
*** Exception: Prelude.read: no parse