@@ -41,6 +41,7 @@ import Control.Applicative ((<|>))
41import Control.Monad (void, when)
41import Control.Monad (void, when)
42import Data.Aeson.Types.Internal (IResult(..), JSONPath, Result(..), Value(..))
42import Data.Aeson.Types.Internal (IResult(..), JSONPath, Result(..), Value(..))
43import Data.Attoparsec.ByteString.Char8 (Parser, char, decimal, endOfInput, isDigit_w8, signed, string)
43import Data.Attoparsec.ByteString.Char8 (Parser, char, decimal, endOfInput, isDigit_w8, signed, string)
44+import Data.Functor.Compat (($>))
44import Data.Scientific (Scientific)
45import Data.Scientific (Scientific)
45import Data.Text (Text)
46import Data.Text (Text)
46import Data.Vector as Vector (Vector, empty, fromListN, reverse)
47import Data.Vector as Vector (Vector, empty, fromListN, reverse)
@@ -174,9 +175,9 @@ value = do
174 DOUBLE_QUOTE -> A.anyWord8 *> (String <$> jstring_)
175 DOUBLE_QUOTE -> A.anyWord8 *> (String <$> jstring_)
175 OPEN_CURLY -> A.anyWord8 *> object_
176 OPEN_CURLY -> A.anyWord8 *> object_
176 OPEN_SQUARE -> A.anyWord8 *> array_
177 OPEN_SQUARE -> A.anyWord8 *> array_
177− C_f -> string "false" *> pure (Bool False)
178+ C_f -> string "false" $> Bool False
178− C_t -> string "true" *> pure (Bool True)
179+ C_t -> string "true" $> Bool True
179− C_n -> string "null" *> pure Null
180+ C_n -> string "null" $> Null
180 _ | w >= 48 && w <= 57 || w == 45
181 _ | w >= 48 && w <= 57 || w == 45
181 -> Number <$> scientific
182 -> Number <$> scientific
182 | otherwise -> fail "not a valid json value"
183 | otherwise -> fail "not a valid json value"
@@ -192,9 +193,9 @@ value' = do
192 return (String s)
193 return (String s)
193 OPEN_CURLY -> A.anyWord8 *> object_'
194 OPEN_CURLY -> A.anyWord8 *> object_'
194 OPEN_SQUARE -> A.anyWord8 *> array_'
195 OPEN_SQUARE -> A.anyWord8 *> array_'
195− C_f -> string "false" *> pure (Bool False)
196+ C_f -> string "false" $> Bool False
196− C_t -> string "true" *> pure (Bool True)
197+ C_t -> string "true" $> Bool True
197− C_n -> string "null" *> pure Null
198+ C_n -> string "null" $> Null
198 _ | w >= 48 && w <= 57 || w == 45
199 _ | w >= 48 && w <= 57 || w == 45
200 !n <- scientific
201 !n <- scientific