Skip to content

Comprehension lists #2172

@manuel-rubio

Description

@manuel-rubio

As a good Erlanger, I like the possibility to perform this kind of action. I know that it's like a shortcut for something we could do with list.map/2 and list.filter/2, but I think that's very expressive and convenient.

It could be implemented in the Erlang way:

[ car || car <- cars, car.country == "DE" ]

or it could be implemented in the Elixir (and almost Python) way:

for car <- cars if car.country == "DE" { car }

what do you think?

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