haskell-beam / haskell-beam/beam
NUMERIC, Scientific, NaN
- Dominant language
- Haskell
- Stars
- 635
- Forks
- 193
- PR merge metrics
- No merged PRs in 30d
Description
A Postgresql NUMERIC value can be NaN, but a Haskell Scientific value cannot.
However, `numeric` links NUMERIC to Scientific. What can I do if I want to use NUMERIC columns with NaN values?
The next best thing I can do is to make the column nullable, but I would rather simply use NaN since Postgresql allows it.
`decimal` does what I want except that I am trying to use decimal fixed-point numbers, which Scientific affords, not binary floating-point numbers.
If instead of:
```
numeric :: BeamSqlBackend be => Maybe (Word, Maybe Word) -> DataType be Scientific
```
there is:
```
numeric :: BeamSqlBackend be => Maybe (Word, Maybe Word) -> DataType be (Maybe Scientific)
```
Then NaN could be represented as `Nothing` and my immediate problem would be fixed, though +/-Inf would still be problematic.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.