Commit ce1b0c05 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

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: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 73b63a40
......@@ -596,6 +596,7 @@ pyType (AppT typ1 typ2) =
pyType (ConT name) = return (pyTypeName name)
pyType ListT = return "ht.TListOf"
pyType (TupleT 0) = return "ht.TNone"
pyType (TupleT _) = return "ht.TTupleOf"
pyType typ = error $ "unhandled case for type " ++ show typ
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment