yesodweb/yesod — Issue #253: yesod-form: intField parses to wrong values
Author: jm-g
Created: 2012-02-04 12:27:42+00:00
State: open

Hi,

I am new to yesod. And stumbled upon the following. I hope it is not a missunderstanding on my side.

Yesod-form's intField seems to convert from text to Int via Double. Which is wrong, because the set of double values is not guaranteed to be a super set of Int values. Especially that is true on 64bit systems.

The problem can be demonstrated with the trivial program in this Gist: https://gist.github.com/1737497 Run that program on 64bit system.

It presents a form with a single item. Enter the value of (maxBound :: Int), i.e. 9223372036854775807. And the web app will return the received value: -9223372036854775616.