Skip to content

Idea of improvement of list generator : size, first, last #16

@scorsi

Description

@scorsi

I felt into some use-cases where Quixir can be improved in my point of view.

Size parameter to a list

I need some list of a given size.
What I do:

list(of: something(), min: x, max: x)

to something like:

list(of: something(), size: x)

First elems to a list

I need to generate a list of a special element except the first one which has to be a specific one.
What I do:

choose(from: [
    list(of: seq(of [something()]), min: 1, max: 1),
    list(of: seq(of [something(), something_else()]), min: 2, max: 2),
    list(of: seq(of [something(), something_else(), something_else()]), min: 3, max: 3),
    # ....
])

to something like:

list(first: [something()], of: something_else(), min: 1, max: 10)

maybe, last options can be useful too.


Maybe I miss something which allow me to resolve my issues, if it's the case, could you show me what I miss ?

Let me know if this can be implemented :)
Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions