- , HMapT f xs
- , HList (HMap f xs)
- ) => HMapT f (HCons x xs) where
- type HMap f (HCons x xs) = HCons (Apply f x) (HMap f xs)
- hMap f (HCons x xs) = hCons (apply f x) (hMap f xs)
-
--- HAll
-type family HAll f l
-type instance HAll f HNil = True
-type instance HAll f (HCons x xs) = If (Apply f x) (HAll f xs) False
-
--- HLength
-type family HLength l
-type instance HLength HNil = D0
-type instance HLength (HCons e l) = Succ (HLength l)
+ , MapT f xs
+ , List (Map f xs)
+ ) => MapT f (Cons x xs) where
+ type Map f (Cons x xs) = Cons (Apply f x) (Map f xs)
+ hMap f (Cons x xs) = hCons (apply f x) (hMap f xs)
+
+-- All
+type family All f l
+type instance All f Nil = True
+type instance All f (Cons x xs) = If (Apply f x) (All f xs) False
+
+-- Length
+type family Length l
+type instance Length Nil = D0
+type instance Length (Cons e l) = Succ (Length l)