-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json-bigint based implementation #13
json-bigint based implementation #13
Conversation
Full rework of library. As for now it is based on json-bigint, internally, our json representation (Aeson) relies on BigNumber from bignumber.js, to represent numbers. This allows us deserialize/serialize JSONs holding arbitrary size numbers, including numbers with floating point.
…to uhbi19-k.havryliuk/json-bigint Drop AesonEncoder etirely
#12 will be probably closed too by this PR. |
cc196be
to
9409e24
Compare
Use Argonaut errors. Better errors. Export from* family of functions Cleanups. Aeson Eq now performs deep structural equalty of underlying entities.
9409e24
to
e83956f
Compare
@klntsky @kirill-havryliuk Resolved already covered comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same everywhere where applicable
`BigInt`s and `Numbers` to avoid serialization of Infinity and NaN Full tests rewrite. Refactoring. Cleanups.
@klntsky @kirill-havryliuk Looks like all issues resolved, no? Merge it? |
@uhbif19 I would like to refactor CTL so it is based on this version first, so if we miss something we still can add it here, and not introduce new PR. |
packages.dhall
Outdated
@@ -137,51 +137,6 @@ let additions = | |||
, repo = "https://github.com/garyb/purescript-mote" | |||
, version = "v1.1.0" | |||
} | |||
-- , medea = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Aeson.purs
Outdated
@@ -406,8 +415,9 @@ caseAesonBigInt def f = | |||
else Nothing | |||
) | |||
|
|||
-- | The reson we return `Finite BigNumber` instead plain `BigNumber` | |||
-- | is to simplify things like `caseAesonBigNumber _ fromFiniteBigNumber` | |||
-- | The reson we return `Finite BigNumber` instead of a plain `BigNumber`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- | The reson we return `Finite BigNumber` instead of a plain `BigNumber`, | |
-- | The reason we return `Finite BigNumber` instead of a plain `BigNumber`, |
test/Gen.purs
Outdated
else map (i <> _) $ go (_size - lenI) | ||
|
||
negSign <- arbitrary | ||
-- forceSign <- arbitrary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
test/Gen.purs
Outdated
<> when withFractional ("." <> fracPart) | ||
<> when withExp ("e" <> expSign <> expPart) | ||
where | ||
-- sign = if negSign then "-" else when forceSign "+" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
058d1fe
to
7a0d9b3
Compare
Closes #12, #11
Full rework of library. Breaking changes.
From now it is based on json-bigint (#11 ).
Internally, our json representation (Aeson) relies on BigNumber from bignumber.js, to represent numbers.
This allows us deserialize/serialize JSONs holding arbitrary size numbers, including numbers with floating point.