TypeChecker lookup
Closed this issue · 2 comments
michaelto20 commented
How do I access TyCtx inside of typeCheck_aux so I can look up the variable type?
heades commented
You should be able to use ask to get the context, and then you can access the context as you do any other list.
heades commented
Actually, its a map. So you use (!) from Data.Map to get the value of a key.
So if you have the name of a variable, say x, then to get its type from the context you do
ctx ! x = ty