X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=Types%2FData%2FList%2FOps.hs;fp=Types%2FData%2FList%2FOps.hs;h=137f226162f8c1f8c93bac195977ec33077d9083;hb=315cb18674266b201bd9eb48efb60edd1f30c41f;hp=0000000000000000000000000000000000000000;hpb=66d175582375d19adfa8747c9e1c468138d47583;p=hs-rrdtool.git diff --git a/Types/Data/List/Ops.hs b/Types/Data/List/Ops.hs new file mode 100644 index 0000000..137f226 --- /dev/null +++ b/Types/Data/List/Ops.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE + TypeFamilies, + UndecidableInstances + #-} +module Types.Data.List.Ops + ( App + , App2 + , App3 + , App4 + , App5 + + , Map + , Foldl + ) + where + +import Types.Data.List + + +type family App f a +type family App2 f a b +type family App3 f a b c +type family App4 f a b c d +type family App5 f a b c d e + +type family Map f l +type instance Map f Null = Null +type instance Map f (Cons x xs) = Cons (App f x) (Map f xs) + +type family Foldl f z l +type instance Foldl f z Null = z +type instance Foldl f z (Cons x xs) = Foldl f (App2 f z x) xs