Skip to content

Type-level sortable singly linked list

License

Notifications You must be signed in to change notification settings

Logarithmus/typelist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typelist

Type-level sortable singly linked list

Motivation

The main purpose is to represent composite units in typeunits

Because Rust lacks variadic generics, the list is implemented as a recursively nested tuple.

This is similar to typenum::TArr, but typelist produces much shorter types in compilation errors:

type List1 = (((() Const<1>), Const<2>), Const<3>)
type List2 = TArr<TArr<TArr<ATerm, Const<1>>, Const<2>>, Const<3>>;

Features

  • merge sort
  • minimum
  • maximum
  • concatenation
  • push
  • pop
  • typenum_list![..] macro for typenum_alias::Const<N> list construction