X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Data%2FHList%2FPrelude.hs;h=c63be3ab5d486cae5c20f4fa35db3231e50c1249;hb=57b97113a93d366f14278a12b8170a1c06e258a1;hp=3eb7e81cc37e80809878498b610dc86ee15b772a;hpb=4611522487b382b839a53e75e3feb2aac8764074;p=hs-rrdtool.git diff --git a/Data/HList/Prelude.hs b/Data/HList/Prelude.hs index 3eb7e81..c63be3a 100644 --- a/Data/HList/Prelude.hs +++ b/Data/HList/Prelude.hs @@ -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)