Revision c2e60027
b/htools/Ganeti/THH.hs | ||
---|---|---|
110 | 110 |
containerField field = field { fieldIsContainer = True } |
111 | 111 |
|
112 | 112 |
-- | Sets custom functions on a field. |
113 |
customField :: Q Exp -> Q Exp -> Field -> Field |
|
113 |
customField :: Name -- ^ The name of the read function |
|
114 |
-> Name -- ^ The name of the show function |
|
115 |
-> Field -- ^ The original field |
|
116 |
-> Field -- ^ Updated field |
|
114 | 117 |
customField readfn showfn field = |
115 |
field { fieldRead = Just readfn, fieldShow = Just showfn }
|
|
118 |
field { fieldRead = Just (varE readfn), fieldShow = Just (varE showfn) }
|
|
116 | 119 |
|
117 | 120 |
fieldRecordName :: Field -> String |
118 | 121 |
fieldRecordName (Field { fieldName = name, fieldConstr = alias }) = |
Also available in: Unified diff