-
Notifications
You must be signed in to change notification settings - Fork 253
Description
The standard lib has a couple different naming conventions that conflict with each other.
For instance, the stdlib has functions for two common operations on sequences: sorting and reversing. Each one has an effectful and a non-effectful variant, which mutate the existing data structure or return a new one respectively. However, they abide by different conventions to communicate this.
For reversing a sequence, the effectful variant is reverse!
and the functional one is reverse
, using the common lisp convention of !
to indicate an effectful function.
On the other hand, sorting uses sort
and sorted
respectively, following a convention most familiar to me in Python.
I personally think the former convention is a little nicer and more productive, but arguably having a consistent naming scheme in either direction would be a step forward.
Since this is a breaking change, we could introduce sort!
as a synonym for sort
without necessarily removing sort
. We couldn't make a non-breaking change in the other direction, introducing reversed
, because the presence of reversed
would imply that reverse
had effectful semantics.