Mutare.Mutators.Collection (mutare v0.1.1)

Copy Markdown View Source

Renames collection calls to a complementary operation:

  • Enum.filterEnum.reject
  • Enum.all?Enum.any?
  • Enum.minEnum.max
  • Enum.min_byEnum.max_by
  • Enum.takeEnum.drop
  • Enum.take_whileEnum.drop_while
  • Enum.take_everyEnum.drop_every
  • Enum.sumEnum.product
  • Map.filterMap.reject
  • Map.takeMap.drop
  • Keyword.filterKeyword.reject
  • Keyword.takeKeyword.drop
  • List.firstList.last
  • List.foldlList.foldr
  • MapSet.filterMapSet.reject
  • Stream.filterStream.reject
  • Stream.takeStream.drop
  • Stream.take_whileStream.drop_while
  • Stream.take_everyStream.drop_every

The family only changes the function name; it does not add or remove arguments. Pairs whose same-arity forms have different meanings, such as Enum.sort/2 and Enum.reverse/2, are therefore not included.

Direct, aliased, and imported calls are supported. An alias that resolves to another module does not match. This family is enabled by default.