Aavesh
Aavesh

Reputation: 65

How to iterate and divide two list by each other in haskell?

So I have a list A = [3,5,6,8,9] and list B = [1,2,..] infinite list

B remains same but A changes and in short I want to return a list C as True or False

-- x from a and y from b
if mod x y == 0:
 then c = True
else False

So in the end the goal is to return a list c which tells if element at particular index is divisible by its index starting from 1.

Upvotes: 0

Views: 102

Answers (1)

Noughtmare
Noughtmare

Reputation: 10645

It sounds like you just want zipWith (\x y -> x `mod` y == 0) a b.

Upvotes: 1

Related Questions