, , List N, N. whit Sized[List[N], N] : List(_1), List(_2, _2) , , List(_3, _3, _3), . , , , :
required: shapeless.Sized[List[shapeless.nat._3],shapeless.nat._3]
, , , List[Nat], . Nat . , - , : HList, , Nat , List[N] List[Nat] Sized.
, List 3,
def lessThanThree[N <: Nat](sz: Sized[List[Nat], N])(implicit ev: LTEq[N, _3]) = sz
, List Nat , N List:
def lessThanThree[N <: Nat, M <: Nat](sz: Sized[List[N], M])(implicit ev: LTEq[N, _3]) = sz
Poly, at Nat, LTEq, , Sized map map, , .. CanBuildFrom. Nat List , , , .
HList, :
object LT3Identity extends Poly{
implicit def only[N <: Nat](implicit ev: LTEq[N, _3]) = at[N]{ i => i}
}
def lt3[L <: HList, M <: Nat](ls: L)(implicit lg: Length.Aux[L, M], lt: LTEq[M, _3]) = ls.map(LT3Identity)
HList 3, HList Nat 3.