Permalink
Browse files

Add Function/compose (#4)

  • Loading branch information...
ocharles committed Jul 5, 2018
1 parent 47d2a12 commit 302881a17491f3c72238975a6c3e7aab603b9a96
Showing with 24 additions and 0 deletions.
  1. +21 −0 Function/compose
  2. +1 −0 Function/package.dhall
  3. +2 −0 package.dhall
@@ -0,0 +1,21 @@
{-
Compose two functions into one.
Examples:
```
./compose Natural Natural Bool (λ(n : Natural) → n + n) ../Natural/even 3
= True
```
-}
let compose
: ∀(a : Type) → ∀(b : Type) → ∀(c : Type) → (a → b) → (b → c) → a → c
= λ(A : Type)
→ λ(B : Type)
→ λ(C : Type)
→ λ(f : A → B)
→ λ(g : B → C)
→ λ(x : A)
→ g (f x)
in compose
@@ -0,0 +1 @@
{ compose = ./compose }
@@ -2,6 +2,8 @@
./Bool/package.dhall
, `Double` =
./Double/package.dhall
, Function =
./Function/package.dhall
, `Integer` =
./Integer/package.dhall
, `List` =

0 comments on commit 302881a

Please sign in to comment.