Skip to content

list-ops: append descriptions do not match inputs #1609

Closed
@wolf99

Description

@wolf99

In the canonical-data.json for the list-ops exercise test case 2 and 3 have descriptions that are conflicting, given the associated inputs.

In the append entries to a list and return the new list cases:

  • Test case 2: "empty list to list" expects list1 input to be appended to list2 input
  • Test case 3: "non-empty lists" expects list2 input to be appended to list1 input

(This is based on the description and the ordering of the values in the expected output..)

Any given implementation can only either append or prepend, but not arbitrarily chose one of append or prepend. Given the name of the cases relates to appending, I understand that append is what was intended, but this is not what these test cases imply.

Additional notes on reading the spec by someone who doesn't know functional operations:

  • In the foldl and foldr test cases it seems ambiguous as to which argument in the function is to be used for the initial value, i.e. is the value from the list x or y? This makes understanding the division operations harder than it should be.
  • when concatenating a list of nested lists is it intended that the empty list is not removed completely as it was in the list of lists? I guess the implication is that it is a "shallow" operation?

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