@@ -621,43 +621,44 @@ instance (FromJSON a) => FromJSON [a] where
621-- Functions
621-- Functions
622-------------------------------------------------------------------------------
622-------------------------------------------------------------------------------
624−-- | @withObject expected f value@ applies @f@ to the 'Object' when @value@ is an @Object@
624+-- | @'withObject' expected f value@ applies @f@ to the 'Object' when @value@
625−-- and fails using @'typeMismatch' expected@ otherwise.
625+-- is an 'Object' and fails using @'typeMismatch' expected@ otherwise.
626withObject :: String -> (Object -> Parser a) -> Value -> Parser a
626withObject :: String -> (Object -> Parser a) -> Value -> Parser a
627withObject _ f (Object obj) = f obj
627withObject _ f (Object obj) = f obj
628withObject expected _ v = typeMismatch expected v
628withObject expected _ v = typeMismatch expected v
629{-# INLINE withObject #-}
629{-# INLINE withObject #-}
631−-- | @withText expected f value@ applies @f@ to the 'Text' when @value@ is a @String@
631+-- | @'withText' expected f value@ applies @f@ to the 'Text' when @value@ is a
632−-- and fails using @'typeMismatch' expected@ otherwise.
632+-- 'String' and fails using @'typeMismatch' expected@ otherwise.
633withText :: String -> (Text -> Parser a) -> Value -> Parser a
633withText :: String -> (Text -> Parser a) -> Value -> Parser a
634withText _ f (String txt) = f txt
634withText _ f (String txt) = f txt
635withText expected _ v = typeMismatch expected v
635withText expected _ v = typeMismatch expected v
636{-# INLINE withText #-}
636{-# INLINE withText #-}
638−-- | @withArray expected f value@ applies @f@ to the 'Array' when @value@ is an @Array@
638+-- | @'withArray' expected f value@ applies @f@ to the 'Array' when @value@ is
639−-- and fails using @'typeMismatch' expected@ otherwise.
639+-- an 'Array' and fails using @'typeMismatch' expected@ otherwise.
640withArray :: String -> (Array -> Parser a) -> Value -> Parser a
640withArray :: String -> (Array -> Parser a) -> Value -> Parser a
641withArray _ f (Array arr) = f arr
641withArray _ f (Array arr) = f arr
642withArray expected _ v = typeMismatch expected v
642withArray expected _ v = typeMismatch expected v
643{-# INLINE withArray #-}
643{-# INLINE withArray #-}
645−-- | @withNumber expected f value@ applies @f@ to the 'Number' when @value@ is a 'Number'.
645+-- | @'withNumber' expected f value@ applies @f@ to the 'Number' when @value@
646−-- and fails using @'typeMismatch' expected@ otherwise.
646+-- is a 'Number' and fails using @'typeMismatch' expected@ otherwise.
647withNumber :: String -> (Number -> Parser a) -> Value -> Parser a
647withNumber :: String -> (Number -> Parser a) -> Value -> Parser a
648withNumber expected f = withScientific expected (f . scientificToNumber)
648withNumber expected f = withScientific expected (f . scientificToNumber)
649{-# INLINE withNumber #-}
649{-# INLINE withNumber #-}
650{-# DEPRECATED withNumber "Use withScientific instead" #-}
650{-# DEPRECATED withNumber "Use withScientific instead" #-}
652−-- | @withScientific expected f value@ applies @f@ to the 'Scientific' number when @value@ is a 'Number'.
652+-- | @'withScientific' expected f value@ applies @f@ to the 'Scientific' number
653−-- and fails using @'typeMismatch' expected@ otherwise.
653+-- when @value@ is a 'Number' and fails using @'typeMismatch' expected@
654withScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a
655withScientific :: String -> (Scientific -> Parser a) -> Value -> Parser a
655withScientific _ f (Number scientific) = f scientific
656withScientific _ f (Number scientific) = f scientific
656withScientific expected _ v = typeMismatch expected v
657withScientific expected _ v = typeMismatch expected v
657{-# INLINE withScientific #-}
658{-# INLINE withScientific #-}
659−-- | @withBool expected f value@ applies @f@ to the 'Bool' when @value@ is a @Bool@
660+-- | @'withBool' expected f value@ applies @f@ to the 'Bool' when @value@ is a
660−-- and fails using @'typeMismatch' expected@ otherwise.
661+-- 'Bool' and fails using @'typeMismatch' expected@ otherwise.
661withBool :: String -> (Bool -> Parser a) -> Value -> Parser a
662withBool :: String -> (Bool -> Parser a) -> Value -> Parser a
662withBool _ f (Bool arr) = f arr
663withBool _ f (Bool arr) = f arr
663withBool expected _ v = typeMismatch expected v
664withBool expected _ v = typeMismatch expected v