haskell - How to return an array with each element responding to a certain check -
i return list of bools each responds check, here javascript example:
if(x == 2) = false; if(x == 3) b = false; if(y == 2) c = false; if(y == 3) d = false; return [a, b, c, d];
dirty example, know. wondering approach might be.
x=5 y=3
elementary
zipwith (==) [x,x,y,y] [2,3,2,3] [false,false,false,true]
or magic
import control.monad (liftm2) liftm2 (==) [x,y] [2,3] [false,false,false,true]
Comments
Post a Comment