~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to test/succeed/QualifiedConstructors.agda

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
module QualifiedConstructors where
3
 
 
4
 
data Nat₁ : Set where
5
 
  zero : Nat₁
6
 
  suc  : Nat₁ → Nat₁
7
 
 
8
 
data Nat₂ : Set where
9
 
  zero : Nat₂
10
 
  suc  : Nat₂ → Nat₂
11
 
 
12
 
zero₁ = Nat₁.zero
13
 
one₂  = Nat₂.suc Nat₂.zero
14
 
 
15
 
record Suc : Set where
16
 
  constructor suc
17
 
  field n : Nat₁
18
 
 
19
 
one₃ = Suc.suc zero₁
20
 
 
21
 
pred : Suc → Nat₁
22
 
pred s = Suc.n s
23
 
 
24
 
conv : Nat₂ → Nat₁
25
 
conv Nat₂.zero    = Nat₁.zero
26
 
conv (Nat₂.suc n) = Nat₁.suc (conv n)
27
 
 
28
 
data _≡_ {A : Set}(x : A) : A → Set where
29
 
  refl : x ≡ x
30
 
 
31
 
inj : (n m : Nat₁) → Nat₁.suc n ≡ suc m → n ≡ m
32
 
inj .m m refl = refl