Optimise codegen for Python OpCode classes
Optimise codegen for Python OpCode classes

This makes hs2py output types like ht.TMaybeBool instead of
ht.TMaybe(ht.TBool). The two have equivalent behaviour, but Python
creates a new callable object at runtime for each instance of the
second, because TMaybe is a higher order function.

This optimisation saves >500kB of heap for "import opcodes" for every
Ganeti Python process.

Signed-off-by: Brian Foley <a00e555871a6a538e97f8c44307104c884f8e869@google.com>
Reviewed-by: Guido Trotter <f62ca4d5358bdaeef0e50e57f9f7e231de63727e@google.com>

mbakke/ganeti,onponomarev/ganeti,yiannist/ganeti,yiannist/ganeti,onponomarev/ganeti,andir/ganeti,leshchevds/ganeti,leshchevds/ganeti,mbakke/ganeti,mbakke/ganeti,andir/ganeti,ganeti/ganeti,ganeti/ganeti,ganeti/ganeti,yiannist/ganeti,andir/ganeti,leshchevds/ganeti