
22 Apr
2016
22 Apr
'16
5:26 p.m.
On Fri, Apr 22, 2016 at 10:20:19PM +0100, Matt Williams wrote:
I am looking for something like:
list1 = [1,2,3,4,5,6] list2 = [1,2,3,4,5,6]
map checkNum list1 list2
to return:
[(1,[1]),(2[3,4,5]),(6,[3])
(I have tried to simplify this a little, so my apologies if it looks pointless - the real function is useful)
Any help would be appreciated.
Matt
Hey Matt, if what you want is [checkNum 1 list2, checkNum 2 list2, etc.] then map (flip checknum list2) list1 is what you want (flip signature being :: (a -> b -> c) -> b -> a -> c)