by pathsjs · 11y ago · 0 comments
Then, at runtime, you can cast an unsized list to a sized list giving - say - a function List[A] => Option[Sized[List[A], N5]] that will fail if the list is not of size 5. From then on you can go on letting the compiler keep track of lengths.
Of course, this does not work at all if you have no clue what size your input will have