@@ -46,7 +46,41 @@ import qualified Data.Dependent.Map as DMap
46import Data.Dependent.Sum (DSum (..))
46import Data.Dependent.Sum (DSum (..))
47import Data.GADT.Compare (GCompare (..), GEq (..), (:~:) (..), GOrdering (..))
47import Data.GADT.Compare (GCompare (..), GEq (..), (:~:) (..), GOrdering (..))
48import Data.Monoid
48import Data.Monoid
49−import Data.HList (HList (..), hBuild)
49+--import Data.HList (HList (..), hBuild)
51+data HList (l::[*]) where
53+ HCons :: e -> HList l -> HList (e ': l)
57+type family HRevApp (l1 :: [k]) (l2 :: [k]) :: [k]
58+type instance HRevApp '[] l = l
59+type instance HRevApp (e ': l) l' = HRevApp l (e ': l')
61+hRevApp :: HList l1 -> HList l2 -> HList (HRevApp l1 l2)
63+hRevApp (HCons x l) l' = hRevApp l (HCons x l')
65+hReverse l = hRevApp l HNil
67+hEnd :: HList l -> HList l
70+hBuild :: (HBuild' '[] r) => r
73+class HBuild' l r where
74+ hBuild' :: HList l -> r
76+instance (l' ~ HRevApp l '[])
77+ => HBuild' l (HList l') where
78+ hBuild' l = hReverse l
80+instance HBuild' (a ': l) r
81+ => HBuild' l (a->r) where
82+ hBuild' l x = hBuild' (HCons x l)
51data Dynamic t a
85data Dynamic t a
52 = Dynamic (Behavior t a) (Event t a)
86 = Dynamic (Behavior t a) (Event t a)