[Haskell-beginners] guards

Chaddaï Fouché chaddai.fouche at gmail.com
Thu Nov 10 23:51:14 CET 2011


On Thu, Nov 10, 2011 at 11:37 PM, kolli kolli <nammukolli04 at gmail.com> wrote:
> its giving me  error
>
>     Couldn't match expected type `Maybe Type'
>            against inferred type `Type'
>     In the second argument of `(==)', namely `TypeBool'
>     In the first argument of `(&&)', namely
>         `typing capGama t1 == TypeBool'
>     In the expression:
>             typing capGama t1 == TypeBool && typing capGama t2 == TypeBool
>

The problem is clearly not that you're using (&&) (which is the
correct way to have two conditions in one guard) but that "typing
capGama t1" is of type "Maybe Type" while TypeBool is of type "Type",
so you can't compare them with an (==), maybe you meant to use "Just
TypeBool" ?

-- 
Jedaï



More information about the Beginners mailing list