An HList keeps track of two things:
- The types of the heterogeneous elements in a list
- Implicitly, the length of the list. I.e., you can write a
HLength type family pretty easily
But do we really need an HList? In our codebase, we always use HReplicateR to create HLists, which suggests that we really just have a homogeneous list. Additionally, I made cursor read through hasktorch, and AI thinks all HLists in the repo are homogeneous.
If the lists are just homogeneous, let's just use a Vec instead (which keeps track of length dependently still).
An HList keeps track of two things:
HLengthtype family pretty easilyBut do we really need an HList? In our codebase, we always use
HReplicateRto create HLists, which suggests that we really just have a homogeneous list. Additionally, I made cursor read throughhasktorch, and AI thinks all HLists in the repo are homogeneous.If the lists are just homogeneous, let's just use a
Vecinstead (which keeps track of length dependently still).