elm-export icon indicating copy to clipboard operation
elm-export copied to clipboard

Remove ElmType instances of non-32bit int types

Open expipiplus1 opened this issue 9 years ago • 0 comments

As requested, here's this change with a more thorough explanation.

Elm's Int type is a 32bit two's complement integer. The exact size of Haskell's Int type is unspecified. Having instances for integral types which don't have an isomorphism to Elm types allows for lossy conversions when moving data between the two languages. For example sending an Elm Int to a Haskell function with type Int8 -> Int8 will only work with 8 bit values and raise an error for any out of range values. By only providing instances for Int32 the user is forced into being more careful with how they marshall integer types between Haskell and Elm.

See https://github.com/elm-lang/core/issues/742#issuecomment-257484290 for information on the specifics of Elm's Int type.

expipiplus1 avatar Nov 05 '16 12:11 expipiplus1