You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I sometimes see people (including me) are puzzled1 by the name of src/alist.ml (accumulated list? not association list!). How about changing its name to something more well-known?
Yes, by Alist I meant “accumulated lists.” I also understand the name is a bit confusing.
The module implements the following requirement:
An 'a t-typed value is essentially an ordered list of 'a-typed values.
Appending an element to the end can be done in $O(1)$.
Conversion of 'a t into 'a list can be done in $O(n)$ where $n$ is the number of elements.
Renaming this module seems to be a good idea for me. Thank you for the suggestion.
However, I’m not willing to rename it to RevList; it’s true that the requirement above is implemented by reversed singly linked lists, but that is an implementation detail, not an inevitable design. I prefer something like AccList.
I prefer SnocList; as the name suggesting, it is an ordered list with 𝑂(1) append-last operation (snoc). It is a FP-jargon, but it is easy to know its meaning by googling.
I sometimes see people (including me) are puzzled1 by the name of
src/alist.ml
(accumulated list? not association list!). How about changing its name to something more well-known?Candidates might be:
Footnotes
(in Japanese) https://twitter.com/elpin1al/status/1244498976771944450 ↩
The text was updated successfully, but these errors were encountered: