Index
Blog

# Int vs AE

I am seeing an issue with Project 0 dealing with Int vs AE in constructors. Specifically, (Plus l r) and (Minus l r). Both constructors take two arguments of type AE not of type Int. Therefore, the test case:

evalAE (Plus 1 2)


will not typecheck. You must use arguments of type AE with Plus, not arguments of type Int. To correct this use:

evalAE (Plus (Num 1) (Num 2))


The same problem is occuring in code snippets that I see. Make sure you don’t try to use Int where you should be using AE.