Thanks a lot for this.

Just to clarify (and ignoring the flip, which I can solve by rewriting the checkNum function) - is this an example of currying?

M

On Fri, 22 Apr 2016 22:30 Francesco Ariis, <fa-ml@ariis.it> wrote:
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)
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners