Skip to content

Some suggested naming changes #3164

Description

@harendra-kumar

Because of termination in folds and scans there are two variants - one-shot and repeated.

  • fold: one-shot fold
  • foldMany => groups: repeated folds, consistent with groupsWhile
  • foldManySepBy => groupsSepBy
  • foldMaybes: maybe stream folded to a Maybe; one-shot
  • groupMaybes: maybe stream folded to Maybes in groups
  • foldEithers: either stream folded to an Either; one-shot
  • groupEithers: either stream foled to Eithers in groups
  • scanlMany => rescanl: restart the scan after it terminates

Changing foldMany to groups makes it shorter and it is still intuitive and consistent with some other names. Alternatively, we can leave it as is and name groupMaybes, groupEtihers to foldManyMaybes, foldManyEithers etc. Or just use inconsistent naming, groups at some place and foldMany at others.

We can leave parseMany as is or rename to parseGroups?

Similar changes can be made to Folds and Parsers.

-- group* can also be named as refold* but group is more intuitive
-- Refold can be named as Infold (suggesting extra input or nesting fusion - like Unfold) instead to avoid confusion.

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

    aspect:apiRelated to api change

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions