module Data.Aeson.Decoding.Internal where

import Data.Aeson.Decoding.Tokens

-- | Helper type-class for constructing errors.
class    AsError t        where tkErr :: e -> t k e
instance AsError Tokens   where tkErr :: forall e k. e -> Tokens k e
tkErr = forall k e. e -> Tokens k e
TkErr
instance AsError TkArray  where tkErr :: forall e k. e -> TkArray k e
tkErr = forall k e. e -> TkArray k e
TkArrayErr
instance AsError TkRecord where tkErr :: forall e k. e -> TkRecord k e
tkErr = forall k e. e -> TkRecord k e
TkRecordErr

negateNumber :: Number -> Number
negateNumber :: Number -> Number
negateNumber (NumInteger Integer
n)    = Integer -> Number
NumInteger (forall a. Num a => a -> a
negate Integer
n)
negateNumber (NumDecimal Scientific
n)    = Scientific -> Number
NumDecimal (forall a. Num a => a -> a
negate Scientific
n)
negateNumber (NumScientific Scientific
n) = Scientific -> Number
NumScientific (forall a. Num a => a -> a
negate Scientific
n)