NILL value in haskell

Posted by snorlaks on Stack Overflow See other posts from Stack Overflow or by snorlaks
Published on 2010-05-28T23:44:10Z Indexed on 2010/05/28 23:52 UTC
Read the original article Hit count: 303

Filed under:

Hello,

I get input (x) from user, convert it to Int by let y = (read x)::Int and then I would like the function to behave in a special way if user gave nothing (empty string).

-- In this place I would like to handle situation in which user
-- gave empty string as argument
-- this doesnt work :/
yearFilter [] y = True

--This works fine as far as y is integer
yearFilter x y  | x == (objectYear y) = True
                | otherwise = False

Thanks for help, Bye

© Stack Overflow or respective owner

Related posts about haskell