Current Code
Hi I have a function like this:
jj::[Int]->[Int]
jj xs = [x|x<-xs,x `mod` 2 ==0]
For the input [1..20] it gives me as output :
[2,4,6,8,10,12,14,16,18,20] -> only the values divisible by 2
What I require
If list value is dividable by 2, it is interpreted as 0 and otherwise as 1:
Input : [243,232,243]
Output : [1,0,1]
Surely you just want map:
Due to currying
is exactly the function we want, so we can just do:
Both yield: