Flipped version of List.cons
nilsbecker opened this issue · 3 comments
nilsbecker commented
I needed fun l e -> e :: l
a few times and did not find that in List
. it's handy to have in particular in point-free |>
style code. would that be a worthwhile addition? did i miss it?
bluddy commented
I believe it's usually called snoc
.
c-cube commented
in my experience snoc
can also mean adding an element at the end (e.g. for a finger tree or a functional deque). In the rest of containers it has this meaning.
bluddy commented
OK you're right. My bad.