Skip to content

FraFrieFa/sorted-hlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sorted-hlist

A zero-cost, type-level heterogeneous list (HList) implementation in Rust with support for compile-time sorting constraints and intersection operations - powered by typenum.

Features

  • Type-level HLists: HCons and HNil
  • Compile-time enforcement of sortedness (SortedHList)
  • Type-level set intersection via the Intersect trait
  • Type-safe macro mk_hlist!(...) for building HLists
  • No runtime overhead - all type-level logic only

Example

use sorted_hlist::{mk_hlist, Intersect};
use typenum::{U1, U2, U3, U4};

// Create type-level HLists
type A = mk_hlist!(U1, U2, U3);
type B = mk_hlist!(U2, U3, U4);

// Compute intersection
type Common = <A as Intersect<B>>::Output;

// Common = mk_hlist!(U2, U3)

Crate Goals

  • Use in embedded HALs or systems programming where traits and sets represent hardware capabilities
  • Keep things fast, predictable, and compile-time checked
  • No dependencies other than typenum

License

Licensed under either of:

Contribution

Pull requests, suggestions and improvements welcome!

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages