Function signature clearly states that it should return a Bool so why is the function returning 96? What is more, compiler thinks that 96 is actually a Bool. Is this a bug?
> isLeapYear year =\
| (modBy 4 year == 0) && (modBy 100 year /= 0) || (modBy 400 year == 0)
<function> : Int -> Bool
> isLeapYear 1996
96 : Bool
It seems to work sometimes though:
> isLeapYear 2000
True : Bool
> isLeapYear 1800
False : Bool
/=operator against a0on either side. For example,1 /= 0and0 /= 1both yield1 : Boolwhile1 /= 2yields the expectedTrue : Bool- Chad Gilbertelm-testoutput. - frostDebug.printsince it is not just in the REPL. - Chad Gilbert