public static class HList { public static HNil HNil() => hnil; public static HCons HCons(H head, T tail) where T : HList => new HCons(head, tail); private static readonly HNil hnil = new HNil(); } public class HList { } public class HNil : HList { } public class HCons : HList> where T : HList { public HCons(H head, T tail) { this.head = head; this.tail = tail; } public readonly H head; public readonly T tail; }