hi, good ... morning : )
I am just confused by the following code
> oneOnly :: [Int]
> oneOnly = [1]
> isOneOnly :: [Int] -> Bool
> isOneOnly oneOnly = True
> isOneOnly tester = False
what I want to do is to define a 'type' oneOnly as [1] and use it on
the pattern matching in function isOneOnly. But it does not work as
I expect:
When I type
isOneOnly [1]
it will be True which is the result I expect but for
is OneOnly [1,2]
the result keeps True, it seems the second pattern has been ignored,
I think I try to achieve the purpose in a wrong way, any suggestion?
Thanks and Merry Christmas
Best wishes,
Raeck
Send e-mail anywhere. No map, no compass. Get your HotmailŪ account now.