diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

`TpData` should have tags and params as two separate lists #93

Closed davidweichiang closed 1 year ago

davidweichiang commented 1 year ago

Come to think of it, if DefCtor and DefData have tags and params as two separate [Var]s (which makes sense), then TpData should have tags and params as two separate lists as well ([Var] and [Type] I guess).

Originally posted by @ccshan in https://github.com/diprism/perpl/issues/79#issuecomment-1198845332

davidweichiang commented 1 year ago

I still think that because tags are used only during type inference, it'd be nicer not to have to drag that (usually empty) list of tags through all the other phases. I'm still hoping that we can distinguish tag and type variables as different cases so we can store them in a single list everywhere...

ccshan commented 1 year ago

But the single list (or both lists) are empty after monomorphization, right?

davidweichiang commented 1 year ago

RIght.

davidweichiang commented 1 year ago

This also affects TmCase and the return value of ctxtLookupType2 (sorry for my terrible naming).

davidweichiang commented 1 year ago

And TmVarG

davidweichiang commented 1 year ago

Closed by #102