Haskell to Python opcodes: fix Unit
authorJose A. Lopes <jabolopes@google.com>
Thu, 29 Aug 2013 12:46:59 +0000 (14:46 +0200)
committerJose A. Lopes <jabolopes@google.com>
Thu, 29 Aug 2013 13:05:40 +0000 (15:05 +0200)
commitce1b0c05a1e034ef75e6897e83be46529d865b6c
treed8fc1232e0c8daea097343e5dfdfb58eaaa46689
parent73b63a40f5d7807751d30dcab678721997628920
Haskell to Python opcodes: fix Unit

Fix how Haskell to Python opcode generation handles unit. It seems
that, in 'template-haskell-2.7.0', unit is represented by Template
Haskell as a constructor of the form '(ConT name)', where 'name' is
the constructor name for 'Unit'.  However, in 'template-haskell-2.8.0'
unit is represented as a tuple with no elements (i.e., 'TupleT 0').
This patch fixes the opcode generation to handle both cases, not just
the first.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
src/Ganeti/THH.hs