You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sized should have at and apply methods analogous to those on HList: they should yield the _n_th element of the collection iff it has at least n elements. For HLists we have,
scala> val l = 1 :: 2 :: 3 :: 4 :: HNil
l: shapeless.::[Int,shapeless.::[Int,shapeless.::[Int,shapeless.::[Int,shapeless.HNil]]]] = 1 :: 2 :: 3 :: 4 :: HNil
scala> l(0)
res0: Int = 1
scala> l(3)
res2: Int = 4
scala> l(4)
<console>:15: error: could not find implicit value for parameter at: shapeless.ops.hlist.At[shapeless.::[Int,shapeless.::[Int,shapeless.::[Int,shapeless.::[Int,shapeless.HNil]]]],nat_$macro$4.N]
l(4)
^
The same would be useful for Sized.
The text was updated successfully, but these errors were encountered:
What should the "apply" do in this case? I can see there are already several applies within the companion object itself. Seems like it should just take some collection and use the SizedConv to return an Option. This close to the idea?
Sized
should haveat
andapply
methods analogous to those onHList
: they should yield the _n_th element of the collection iff it has at least n elements. ForHLists
we have,The same would be useful for
Sized
.The text was updated successfully, but these errors were encountered: