kframework / haskell-core-semantics

Haskell's Core in K.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Represent ADT constructors

ayberkt opened this issue · comments

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).

@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