Skip to content

Commit 5fd9078

Browse files
authored
Merge pull request #567 from phadej/export-jsstring-scientific
Export jstring_ and scientific parsers
2 parents cfb3cb9 + 81fec00 commit 5fd9078

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Data/Aeson/Parser.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module Data.Aeson.Parser
3333
json
3434
, value
3535
, jstring
36+
, scientific
3637
-- * Strict parsers
3738
-- $strict
3839
, json'
@@ -46,7 +47,7 @@ module Data.Aeson.Parser
4647

4748
import Prelude ()
4849

49-
import Data.Aeson.Parser.Internal (decodeStrictWith, decodeWith, eitherDecodeStrictWith, eitherDecodeWith, json, json', jstring, value, value')
50+
import Data.Aeson.Parser.Internal (decodeStrictWith, decodeWith, eitherDecodeStrictWith, eitherDecodeWith, json, json', jstring, scientific, value, value')
5051

5152
-- $lazy
5253
--

Data/Aeson/Parser/Internal.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ module Data.Aeson.Parser.Internal
2323
json, jsonEOF
2424
, value
2525
, jstring
26+
, jstring_
27+
, scientific
2628
-- * Strict parsers
2729
, json', jsonEOF'
2830
, value'
@@ -334,7 +336,7 @@ decimal0 = do
334336
then fail "leading zero"
335337
else return (B.foldl' step 0 digits)
336338

337-
{-# INLINE scientific #-}
339+
-- | Parse a JSON number.
338340
scientific :: Parser Scientific
339341
scientific = do
340342
let minus = 45
@@ -364,3 +366,4 @@ scientific = do
364366
(A.satisfy (\ex -> ex == littleE || ex == bigE) *>
365367
fmap (Sci.scientific signedCoeff . (e +)) (signed decimal)) <|>
366368
return (Sci.scientific signedCoeff e)
369+
{-# INLINE scientific #-}

aeson.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ library
9393
Data.Aeson.Encoding.Internal
9494
Data.Aeson.Internal
9595
Data.Aeson.Internal.Time
96+
Data.Aeson.Parser.Internal
9697

9798
-- Deprecated modules
9899
exposed-modules:
@@ -101,7 +102,6 @@ library
101102
other-modules:
102103
Data.Aeson.Encoding.Builder
103104
Data.Aeson.Internal.Functions
104-
Data.Aeson.Parser.Internal
105105
Data.Aeson.Parser.Unescape
106106
Data.Aeson.Parser.Time
107107
Data.Aeson.Types.FromJSON

0 commit comments

Comments
 (0)