aeson-extra-0.4.0.0: Extra goodies for aeson

Copyright | (C) 2015-2016 Oleg Grenrus
License | BSD3
Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi>
Safe Haskell | None
Language | Haskell2010

Data.Aeson.Extra.Time

Description

Time tools

Synopsis

- newtype U = U {
  - getU :: UTCTime
  }
- newtype Z = Z {
  - getZ :: ZonedTime
  }

# Documentation

newtype U Source #

A type to parse `UTCTime`

`FromJSON` instance accepts for example:

    2015-09-07T08:16:40.807Z
    2015-09-07 11:16:40.807 +03:00

Latter format is accepted by `aeson` staring from version `0.10.0.0`.

See https://github.com/bos/aeson/blob/4667ef1029a373cf4510f7deca147c357c6d8947/Data/Aeson/Parser/Time.hs#L150

Since: aeson-extra-0.2.2.0

Constructors

U |

Fields

- getU :: UTCTime

Instances

Eq U Source # |
Methods (==) :: U -> U -> Bool # (/=) :: U -> U -> Bool #
Ord U Source # |
Methods compare :: U -> U -> Ordering # (<) :: U -> U -> Bool # (<=) :: U -> U -> Bool # (>) :: U -> U -> Bool # (>=) :: U -> U -> Bool # max :: U -> U -> U # min :: U -> U -> U #
Read U Source # |
Methods readsPrec :: Int -> ReadS U # readList :: ReadS [U] # readPrec :: ReadPrec U # readListPrec :: ReadPrec [U] #
Show U Source # |
Methods showsPrec :: Int -> U -> ShowS # show :: U -> String # showList :: [U] -> ShowS #
ToJSON U Source # |
Methods toJSON :: U -> Value # toEncoding :: U -> Encoding # toJSONList :: [U] -> Value # toEncodingList :: [U] -> Encoding #
FromJSON U Source # |
Methods parseJSON :: Value -> Parser U # parseJSONList :: Value -> Parser [U] #

newtype Z Source #

A type to parse `ZonedTime`

Since: aeson-extra-0.2.2.0

Constructors

Z |

Fields

- getZ :: ZonedTime

Instances

Read Z Source # |
Methods readsPrec :: Int -> ReadS Z # readList :: ReadS [Z] # readPrec :: ReadPrec Z # readListPrec :: ReadPrec [Z] #
Show Z Source # |
Methods showsPrec :: Int -> Z -> ShowS # show :: Z -> String # showList :: [Z] -> ShowS #
ToJSON Z Source # |
Methods toJSON :: Z -> Value # toEncoding :: Z -> Encoding # toJSONList :: [Z] -> Value # toEncodingList :: [Z] -> Encoding #
FromJSON Z Source # |
Methods parseJSON :: Value -> Parser Z # parseJSONList :: Value -> Parser [Z] #