Skip to content

Commit ee7abc0

Browse files
committed
Split EtaFunctions into a file in which there are explicit arguments and implicit arguments for a def
1 parent 96aba4d commit ee7abc0

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

test/EtaFunctions.agda

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ data Nat : Set where
1515
comp : (A B C : Set) (B C) (A B) A C
1616
comp = λ (A B C : Set) λ f λ g λ x f (g x)
1717

18-
const : (A : Set) A A A
19-
const = λ A λ x λ y x
18+
const : {A : Set} A A A
19+
const = λ x λ y x
2020

21-
addOne : Nat -> Nat
21+
addOne : Nat Nat
2222
addOne = suc
2323

2424
addTwo : Nat Nat
@@ -27,9 +27,9 @@ addTwo = λ x → (suc (suc x))
2727
addTwoAfterAddOne : Nat Nat
2828
addTwoAfterAddOne = λ x (comp Nat Nat Nat addTwo addOne x)
2929

30-
eta-higher : (A B C : Set) (f : A B C) (λ x λ y f (const A x x) y) ≡ f
30+
eta-higher : (A B C : Set) (f : A B C) (λ x λ y f (const x x) y) ≡ f
3131
eta-higher = λ A B C λ f refl
3232

33-
eta-counterexample-simple : addOne ≡ (λ x (suc (const Nat x x)))
33+
eta-counterexample-simple : addOne ≡ (λ x (suc (const x x)))
3434
eta-counterexample-simple = refl
3535

test/EtaFunctionsExplDefArg.agda

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module EtaFunctionsExplDefArg where
2+
3+
data _≡_ {A : Set} (x : A) : A Set where
4+
refl : x ≡ x
5+
6+
data Nat : Set where
7+
zero : Nat
8+
suc : Nat Nat
9+
10+
-- postulate
11+
-- _≡_ : {A : Set} (x : A) → A → Set
12+
-- refl : {A : Set} {x : A} → x ≡ x
13+
14+
-- Composition operator ∘
15+
comp : (A B C : Set) (B C) (A B) A C
16+
comp = λ (A B C : Set) λ f λ g λ x f (g x)
17+
18+
const : (A : Set) A A A
19+
const = λ A λ x λ y x
20+
21+
addOne : Nat -> Nat
22+
addOne = suc
23+
24+
addTwo : Nat Nat
25+
addTwo = λ x (suc (suc x))
26+
27+
addTwoAfterAddOne : Nat Nat
28+
addTwoAfterAddOne = λ x (comp Nat Nat Nat addTwo addOne x)
29+
30+
eta-higher : (A B C : Set) (f : A B C) (λ x λ y f (const A x x) y) ≡ f
31+
eta-higher = λ A B C λ f refl
32+
33+
eta-counterexample-simple : addOne ≡ (λ x (suc (const Nat x x)))
34+
eta-counterexample-simple = refl

0 commit comments

Comments
 (0)