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 a0
on either side. For example,1 /= 0
and0 /= 1
both yield1 : Bool
while1 /= 2
yields the expectedTrue : Bool
– Chad Gilbertelm-test
output. – frostDebug.print
since it is not just in the REPL. – Chad Gilbert