protocol HListProtocol { associatedtype HeadType associatedtype ConsType: HListProtocol func asEnum() -> EHList<HeadType, ConsType> } indirect enum EHList<H, L: HListProtocol> { case `nil` case cons(H, EHList<L.HeadType, L.ConsType>) }