Skip to content

Differences in Base.Iterators.map and IterTools.imap #123

Open
@PatrickHaecker

Description

@PatrickHaecker

We should document the difference between Base.Iterators.map and IterTools.imap or document that there is no difference.

I think that there is no difference, but I am not certain that

map(f, arg, args...) = Base.Generator(f, arg, args...)

and

imap(mapfunc, it1, its...) = (mapfunc(xs...) for xs in zip(it1, its...))

always will behave identical. Both create a Base.Generator and I think the zip does not change here anything as Generator is also using zip:

Generator(f, I1, I2, Is...) = Generator(a->f(a...), zip(I1, I2, Is...))

Can someone confirm, that they are identical, so that we can create a PR to document it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions