Closed decafbad closed 5 years ago
Good catch.
I'm inclined to treat "--2" as invalid. Can you provide any reasons for why "--" might be a useful pattern?
Thanks
I was working on a Fraction library based on this one. My own bug raised this problem. All kinds of malformed string should return Nothing anyways.
Gonna re-open this, as I am working on a fix.
Output of
fromString "--2"
isJust (Neg (Magnitude [-2]))
Then, this happens:
Maybe.map (mul (fromInt -3)) (fromString "--2") |> Maybe.map toString
Just "-19999994"