For some reason, when I run the code with for exmaple let's say split1 [1,2,3,4,5,6,7,8,9,10] I get an error
p :: Int -> Bool
p x = if x < 5 then True else False
split1 [xs] = [([x,y]) | x <- [xs], y <- [xs], p x == True, p y == False]
Even if I run it with split1 [1] I get an empty set. Can someone tell me where i'm wrong? Thanks.
p x = if x<5 then True else False, and simply use the simpler equivalentp x = x<5. Similarly,p x == Trueis equivalent top x, andp y == Falseis equivalent tonot (p y). - chi