2-- Module: Data.Aeson.Types
3-- Copyright: (c) 2011-2016 Bryan O'Sullivan
4-- (c) 2011 MailRank, Inc.
6-- Maintainer: Bryan O'Sullivan <bos@serpentine.com>
7-- Stability: experimental
8-- Portability: portable
10-- Types for working with JSON data.
12module Data.Aeson.Types
25 -- * Convenience types and functions
44 , ToJSONKeyFunction(..)
46 , contramapToJSONKeyFunction
48 , FromJSONKeyFunction(..)
50 , coerceFromJSONKeyFunction
51 , mapFromJSONKeyFunction
53 -- ** Liftings to unary and binary type constructors
65 -- ** Generic JSON classes
76 , genericLiftToEncoding
78 , genericLiftParseJSON
80 -- * Inspecting @'Value's@
100 , explicitParseFieldMaybe
101 , explicitParseFieldMaybe'
107 -- * Generic and TH encoding configuration
113 , constructorTagModifier
114 , allNullaryToStringTag
118 , tagSingleConstructors
120 -- ** Options utilities
125 , defaultTaggedObject
131import Data.Aeson.Encoding (Encoding, unsafeToEncoding, fromEncoding, Series, pairs)
132import Data.Aeson.Types.Class
133import Data.Aeson.Types.Internal
134import Data.Foldable (toList)
136-- | Encode a 'Foldable' as a JSON array.
137foldable :: (Foldable t, ToJSON a) => t a -> Encoding
138foldable = toEncoding . toList
139{-# INLINE foldable #-}
142-- The functions here are in fact record fields of the 'Options' type.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list