c-cube/ocaml-containers

Flipped version of List.cons

nilsbecker opened this issue · 3 comments

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?

I believe it's usually called snoc.

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.

OK you're right. My bad.