Question: ( 2 0 points ) . Redefine the following function positions: positions :: Eq a = > a - > [ a ] - >

(20 points). Redefine the following function positions:
positions :: Eq a => a ->[a]->[Int]
positions x xs =[i |(x,i)<- zip xs [0..], x == x]
using the following function find:
find :: Eq a => a ->[(a,b)]->[b]
find k t =[v |(k,v)<- t, k == k]
Hint: the simplest solution will still involve zip, but it need not be in a list comprehension anymore,
due to the usage of find.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!