Represent ADT constructors
ayberkt opened this issue · comments
Ayberk Tosun commented
Constructors for an ADT are not in the CoreExpr
type. To implement these we'll have to update the KORE representation of GHC Core so that it contains this information (which is present in the ModGuts
type).
Ayberk Tosun commented
@bmmoore now ADT constructors are represented at the Core-level. For example, running to-core --no-types Nats
includes the following Core-level representation of Nat
:
algTyCon(name(Nat), [type omitted],
algTyConRhs(DataConCons(dataCon(name(Z), arity(0)),
DataConCons(dataCon(name(S), arity(1)),
DataConEmpty))))
/cc: @lucaspena