ganeti

Safe HaskellNone

Ganeti.THH.Field

Contents

Description

Helpers for creating various kinds of Fields.

They aren't directly needed for the Template Haskell code in Ganeti.THH, so better keep them in a separate module.

Synopsis

Internal functions

numericalReadFn :: JSON a => (String -> Result a) -> [(String, JSValue)] -> JSValue -> Result aSource

specialNumericalField :: Name -> Field -> FieldSource

Sets the read function to also accept string parsable by the given function.

timeAsDoubleField :: String -> FieldSource

Creates a new mandatory field that reads time as the (floating point) number of seconds since the standard UNIX epoch, and represents it in Haskell as ClockTime.

integralField :: Q Type -> String -> FieldSource

External functions and data types

timeStampFields :: [Field]Source

Timestamp fields description.

serialFields :: [Field]Source

Serial number fields description.

uuidFields :: [Field]Source

UUID fields description.

type TagSet = Set StringSource

Tag set type alias.

tagsFields :: [Field]Source

Tag field description.

Fields related to POSIX data types

fileModeAsIntField :: String -> FieldSource

Creates a new mandatory field that reads a file mode in the standard POSIX file mode representation. The Haskell type of the field is FileMode.

processIdField :: String -> FieldSource

Creates a new mandatory field that contains a POSIX process ID.