Revision 26e32dee src/Ganeti/THH.hs
b/src/Ganeti/THH.hs | ||
---|---|---|
66 | 66 |
, buildObject |
67 | 67 |
, buildObjectSerialisation |
68 | 68 |
, buildParam |
69 |
, DictObject(..) |
|
70 |
, ArrayObject(..) |
|
71 | 69 |
, genException |
72 | 70 |
, excErrMsg |
73 | 71 |
) where |
... | ... | |
97 | 95 |
|
98 | 96 |
-- * Exported types |
99 | 97 |
|
100 |
-- | Class of objects that can be converted from and to 'JSObject' |
|
101 |
-- lists-format. |
|
102 |
class DictObject a where |
|
103 |
toDict :: a -> [(String, JSON.JSValue)] |
|
104 |
fromDict :: [(String, JSON.JSValue)] -> JSON.Result a |
|
105 |
|
|
106 |
-- | Class of objects that can be converted from and to @[JSValue]@ with |
|
107 |
-- a fixed length and order. |
|
108 |
class ArrayObject a where |
|
109 |
toJSArray :: a -> [JSON.JSValue] |
|
110 |
fromJSArray :: [JSON.JSValue] -> JSON.Result a |
|
111 |
|
|
112 | 98 |
-- | Optional field information. |
113 | 99 |
data OptionalType |
114 | 100 |
= NotOptional -- ^ Field is not optional |
Also available in: Unified diff