diff --git a/htools/Ganeti/THH.hs b/htools/Ganeti/THH.hs index 21c5d1757690a79cdf34fe3abc859c1aca868e92..b6f134c6134b573304ce8ffa19ee33da745736e3 100644 --- a/htools/Ganeti/THH.hs +++ b/htools/Ganeti/THH.hs @@ -110,9 +110,12 @@ containerField :: Field -> Field containerField field = field { fieldIsContainer = True } -- | Sets custom functions on a field. -customField :: Q Exp -> Q Exp -> Field -> Field +customField :: Name -- ^ The name of the read function + -> Name -- ^ The name of the show function + -> Field -- ^ The original field + -> Field -- ^ Updated field customField readfn showfn field = - field { fieldRead = Just readfn, fieldShow = Just showfn } + field { fieldRead = Just (varE readfn), fieldShow = Just (varE showfn) } fieldRecordName :: Field -> String fieldRecordName (Field { fieldName = name, fieldConstr = alias }) =