X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=hs-rrdtool.git;a=blobdiff_plain;f=Data%2FHList%2FPrelude.hs;fp=Data%2FHList%2FPrelude.hs;h=c63be3ab5d486cae5c20f4fa35db3231e50c1249;hp=3ab596ffb1e45c2aacf9484384b5f9334e454f81;hb=57b97113a93d366f14278a12b8170a1c06e258a1;hpb=a584a7c4d5ff7e6651f41070b0d2d5032d49b0dd diff --git a/Data/HList/Prelude.hs b/Data/HList/Prelude.hs index 3ab596f..c63be3a 100644 --- a/Data/HList/Prelude.hs +++ b/Data/HList/Prelude.hs @@ -28,7 +28,7 @@ module Data.HList.Prelude , HConcatable(..) , HMappable(..) - , HLength(..) + , HLength ) where @@ -158,16 +158,6 @@ instance ( Applyable f x hMap f (HCons x xs) = hCons (apply f x) (hMap f xs) -- HLength -class IntegerT (HLengthOf l) => HLength l where - type HLengthOf l - hLength :: Integral n => l -> n - -instance HLength HNil where - type HLengthOf HNil = D0 - hLength _ = 0 - -instance ( HLength l - , IntegerT (Succ (HLengthOf l)) - ) => HLength (HCons e l) where - type HLengthOf (HCons e l) = Succ (HLengthOf l) - hLength (HCons _ l) = 1 + hLength l +type family HLength l +type instance HLength HNil = D0 +type instance HLength (HCons e l) = Succ (HLength l)