diff --git a/theories/hlist.v b/theories/hlist.v index a0c7070858a4f8dc508963cf2cbceb3f37219e65..be1f20dbff76086af95f93c606c9ecd1eda7ae57 100644 --- a/theories/hlist.v +++ b/theories/hlist.v @@ -16,3 +16,13 @@ Definition happly {As B} (f : himpl As B) (xs : hlist As) : B := | hnil => λ f, f | hcons A As x xs => λ f, go As xs (f x) end) _ xs f. +Coercion happly : himpl >-> Funclass. + +Fixpoint hcompose {As B C} (f : B → C) {struct As} : himpl As B → himpl As C := + match As with + | tnil => f + | tcons A As => λ g x, hcompose f (g x) + end. + +Definition hinit {B} (y : B) : himpl tnil B := y. +Definition hlam {A As B} (f : A → himpl As B) : himpl (tcons A As) B := f.