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

« back to all changes in this revision

Viewing changes to test/succeed/LetPair.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
 
 
3
 
module LetPair where
4
 
 
5
 
import Common.Level
6
 
open import Common.Equality
7
 
 
8
 
infixl 6 _×_
9
 
infixl 0 _,_
10
 
 
11
 
record _×_ (A B : Set) : Set where
12
 
  constructor _,_
13
 
  field
14
 
    fst : A
15
 
    snd : B
16
 
open _×_
17
 
 
18
 
swap : {A B : Set} → A × B → B × A
19
 
swap p =
20
 
  let (a , b) = p
21
 
  in  (b , a)
22
 
 
23
 
prop_swap : {A B : Set}{p : A × B} →
24
 
  (fst (swap p) ≡ snd p) ×
25
 
  (snd (swap p) ≡ fst p)
26
 
prop_swap = refl , refl
27
 
 
28
 
rot3 : {A B C : Set} → A × B × C → B × C × A
29
 
rot3 = λ t → let
30
 
      a , b , c = t
31
 
  in  b , c , a
32
 
 
33
 
postulate
34
 
  A B C : Set
35
 
 
36
 
rot3' = λ t → let
37
 
      x : A × B × C
38
 
      x = t
39
 
      a , b , c = x
40
 
  in  b , c , a
41
 
 
42
 
record ⊤ : Set where
43
 
  constructor tt
44
 
 
45
 
test = let tt , _ = tt , tt in A
46