base icon indicating copy to clipboard operation
base copied to clipboard

Support for non-empty lists

Open johnyob opened this issue 3 years ago • 5 comments

It would be great if Base provided a List.Non_empty module for non-empty lists

type 'a t = (::) of 'a * 'a list

johnyob avatar Oct 21 '22 18:10 johnyob

Does the Nonempty_list library do what you need? You can get it by installing core_kernel and using core_kernel.nonempty_list in your dune file.

bcc32 avatar Oct 24 '22 11:10 bcc32

I was unaware of this Nonempty_list library in Core_kernel.

Nonetheless, it was my understanding that Core_kernel was going to be deprecated at some point. Will this Nonempty_list library be merged into Base or Core?

johnyob avatar Oct 24 '22 13:10 johnyob

Core_kernel the library has been deprecated, but the opam package still remains. We're not planning on merging Nonempty_list into Base or Core anytime soon, but it's possible the best way to handle this is to release it as a separate, one-module package, rather than bundling it with a bunch of unrelated libraries.

I think @staronj or maybe @tov is the right person to think about this (low confidence)?

bcc32 avatar Oct 26 '22 02:10 bcc32

That sounds fine to me (low confidence), but I'm wondering if there's a reason not to move it to core.

tov avatar Oct 26 '22 13:10 tov

We intend to move Nonempty_list into Base but it's not at the top of our stack. We'll update this issue if and when that happens.

nmatschke avatar Jul 18 '25 18:07 nmatschke