MCPcopy Index your code
hub / github.com/cloudhead/nonempty

github.com/cloudhead/nonempty @v0.12.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.12.0 ↗ · + Follow
83 symbols 135 edges 2 files 45 documented · 54%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Correct by Construction Non-Empty List

This package exposes a type NonEmpty<T> with a data representation that guarantees non-emptiness statically:

struct NonEmpty<T>(T, Vec<T>)

The library is meant to have an interface similar to std::vec::Vec:

use nonempty::NonEmpty;

let mut l = NonEmpty::new(42);

assert_eq!(l.first(), &42);

l.push(36);
l.push(58);

let v: Vec<i32> = l.into();
assert_eq!(v, vec![42, 36, 58]);

Core symbols most depended-on inside this repo

into_iter
called by 6
src/lib.rs
iter
called by 5
src/lib.rs
collect
called by 4
src/lib.rs
sort
called by 4
src/lib.rs
len
called by 3
src/lib.rs
map
called by 3
src/lib.rs
maximum_by
called by 3
src/lib.rs
push
called by 2
src/lib.rs

Shape

Method 59
Function 18
Class 5
Enum 1

Languages

Rust100%

Modules by API surface

src/lib.rs73 symbols
src/nonzero.rs10 symbols

For agents

$ claude mcp add nonempty \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact