History | View | Annotate | Download (46.5 kB)
Use a data type when generating Python types of OpCodes
Currently they are generated only as Strings.
Signed-off-by: Petr Pudlak <pudlak@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Refactor OpCodeDescriptor from a tuple to a data type
This greatly enhances code readability.
Also fix monadic types "Q ExpQ" [which is "Q (Q Exp)"] to "Q Exp".
Rename PyValueInstances.hs to PyValue.hs
Now the file contains the type class declaration as well.
Move PyValue into PyValueInstances.hs, import it in THH.hs
This puts all PyValue code into one module, getting rid of orphaninstances.
Support fieldRead in partial params
While from parameters both full and partial versions are generated,with in the partial version all types mapped to Maybe, the fieldReadparameter of the field was not wrapped accordingly. So far, that didn'tmatter, as it was always Nothing in this case, but for supporting special...
Add a field-transformer for accepting parser
Add a transformer for numerical fields, to also acceptstrings instead of numbers if they can be parsed by thegiven parser.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Hs2Py constants: add 'becDefaults'
Add constant 'becDefaults' to the Haskell to Python constantgeneration. An instance of 'PyValue' is added to the type 'PyValueEx'in order to allow polymorphic types, namely, 'Map's.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Remove 'Show' from 'PyValue' class
Remove 'Show' constraint from the 'PyValue' class which, even thoughit allowed to simplify the definition of instances of this class forprimitive types, it made it more complicated to define instances forother types....
Add 'declareILADT' to declare integer literal datatypes
Add 'declareILADT' to declare integer literal datatypes.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Add Template Haskell 'declareLADT'
Add 'declareLADT' in Template Haskell module to declare Haskelldatatypes using 'String's directly as values for the JSONserialization, as opposed to 'Name's which is what the current'declareADT' allows. To achieve this, 'genFromRaw' must be...
Wrap 'Set' in 'ListSet' for the opcodes
In what Haskell to Python opcodes are concerned, a Haskell 'Set' istranslated into a Python 'list'. In other words, currently, opcodesthat handle sets of parameters are actually handling lists becausethis is how sets are currently encoded. This patch introduces a new...
Haskell to Python opcodes: fix Unit
Fix how Haskell to Python opcode generation handles unit. It seemsthat, in 'template-haskell-2.7.0', unit is represented by TemplateHaskell as a constructor of the form '(ConT name)', where 'name' isthe constructor name for 'Unit'. However, in 'template-haskell-2.8.0'...
Add Template Haskell code for constant generation
Add Template Haskell functions that generate a list in Haskellcontaining all the constants to be generated in Python. This list isan association list mapping the constant name to its Python value,which is stored as a string....
Add Python opcode generation
Merge stable-2.7 into stable-2.8
Conflicts: INSTALL NEWS configure.ac src/Ganeti/Query/Group.hs test/hs/Test/Ganeti/Objects.hs test/hs/Test/Ganeti/Query/Query.hs
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Fix typo in documentation string
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Improve TemplateHaskell code to support empty objects
Currently, an empty objects will generate warnings as the arguments ofvarious functions are unused. By adding conditional code for this, wecan support generation of empty objects, e.g. like needed in Rpc code....
Rename htools/ to src/
Per offline discussions, this is the first patch of therenames. Tested with "make distcheck", seems to work fine.
The only change outside of the renaming is a bit of simplification inthe .gitignore rules; otherwise, simply s/htools/src/....