]> gitweb @ CieloNegro.org - hs-rrdtool.git/blobdiff - Data/HList/Prelude.hs
revised HLength
[hs-rrdtool.git] / Data / HList / Prelude.hs
index 3eb7e81cc37e80809878498b610dc86ee15b772a..c63be3ab5d486cae5c20f4fa35db3231e50c1249 100644 (file)
@@ -27,10 +27,13 @@ module Data.HList.Prelude
     , HFoldrable(..)
     , HConcatable(..)
     , HMappable(..)
+
+    , HLength
     )
     where
 
 import Data.Typeable
+import Types.Data.Num hiding ((:*:))
 
 
 -- HList
@@ -153,3 +156,8 @@ instance ( Applyable f x
          ) => HMappable 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)
+
+-- HLength
+type family HLength l
+type instance HLength HNil        = D0
+type instance HLength (HCons e l) = Succ (HLength l)