On Tue, Mar 4, 2014 at 4:11 PM, Klaus Aehlig <[email protected]> wrote:

> On Tue, Mar 04, 2014 at 03:38:36PM +0100, Petr Pudlak wrote:
> > This is in particular needed for RPC requests which are serialized this
> > way and therefore using `showJSON` on the generated objects doesn't
> > work.
> >
> > The fiels are serialized in the order they're declared, together with
> > any extra fields they declare.
> >
> > Signed-off-by: Petr Pudlak <[email protected]>
> > ---
> >  src/Ganeti/THH.hs | 54
> +++++++++++++++++++++++++++++++++++++++++++++++++-----
> >  1 file changed, 49 insertions(+), 5 deletions(-)
>
> > @@ -1024,11 +1065,14 @@ genDictObject save_fn load_fn sname fields = do
> >    -- fromDict
> >    fdexp <- loadConstructor name load_fn fields
> >    let fdclause = Clause [VarP objVarName] (NormalB fdexp) []
> > -  -- the final instance
> > -  return [InstanceD [] (AppT (ConT ''DictObject) (ConT name))
> > -           [ FunD 'toDict [tdclause]
> > -           , FunD 'fromDict [fdclause]
> > -           ]]
> > +  -- the ArrayObject instance generated from DictObject
> > +  arrdec <- genArrayObjectInstance name fields
> > +  -- the final instance __________
>

Thanks for noticing, yes, I'll remove it. It used to separate parts of the
function where it was more complex.


>
> I don't see the value of the _s in the comment. Remove?
>
> > +  return $ [InstanceD [] (AppT (ConT ''DictObject) (ConT name))
> > +             [ FunD 'toDict [tdclause]
> > +             , FunD 'fromDict [fdclause]
> > +             ]]
> > +         ++ [arrdec]
> >
> >  -- | Generates the save object functionality.
> >  genSaveObject :: String -> Q [Dec]
>
> Rest LGTM (no need to resend).
>
> --
> Klaus Aehlig
> Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
>

Reply via email to