
On Thu, 10 Nov 2011 15:55:48 -0700, kolli kolli
I have to feame the code saying in IF t1 t2 t3
If t1 has type x and if type of t2 == type of t3 then return type of t2 or t3
As Chaddaï said, the result of a call to typing has type Maybe Type while TypeBool has type Type, so you would have to compare the result with Just TypeBool, and not just TypeBool. The same applies to "where x = typing capGamma t3". Here x already has type Maybe Type, so passing it to Just would give you a value of type Maybe (Maybe Type). This can be resolved by returning x directly in this case: ... | typing capGama t1 == TypeBool && typing capGama t2 == x = x A minor stylistic comment: It's common to write `Just TypeBool' instead of `Just(TypeBool)', since a constructor is really just a (special kind of) function. Cheers, Daniel