Typeclass for HList-y behaviour
An HList is a heterogeneous list, one that is statically typed at compile time. In simple terms,
it is just an arbitrarily-nested Tuple2.
Returns the length of a given HList type without making use of any references, or
in fact, any values at all.
use frunk::prelude::*;
assert_eq!(<Hlist![i32, bool, f32]>::LEN, 3);
Run
Loading content...👎 Deprecated since 0.1.31:
Please use LEN instead
Returns the length of a given HList type without making use of any references, or
in fact, any values at all.
use frunk::prelude::*;
assert_eq!(<Hlist![i32, bool, f32]>::static_len(), 3);
Run
Loading content...👎 Deprecated since 0.1.30:
Please use len() or static_len() instead.
Returns the length of a given HList
let h = hlist![1, "hi"];
assert_eq!(h.len(), 2);
Run
Returns whether a given HList is empty
let h = hlist![];
assert!(h.is_empty());
Run
Prepends an item to the current HList
let h1 = hlist![1, "hi"];
let h2 = h1.prepend(true);
let (a, (b, c)) = h2.into_tuple2();
assert_eq!(a, true);
assert_eq!(b, 1);
assert_eq!(c, "hi");
Run
Loading content...👎 Deprecated since 0.1.31:
Please use LEN instead
👎 Deprecated since 0.1.31:
Please use LEN instead
Loading content...