Effect CommunityEC
Effect Community3y ago
13 replies
kalda341

Questioning the input type of `ReadonlyArray.groupWith`

Hi all,
Why is the input type of ReadonlyArray.groupWith NonEmptyReadonlyArray?
The type signature is currently:
  <A>(self: NonEmptyReadonlyArray<A>, isEquivalent: (self: A, that: A) => boolean): NonEmptyArray<NonEmptyArray<A>>

I would have thought the following would be more appropriate:
  <A>(self: ReadonlyArray<A>, isEquivalent: (self: A, that: A) => boolean): ReadonlyArray<NonEmptyArray<A>>
Was this page helpful?