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

« back to all changes in this revision

Viewing changes to test/succeed/WithInParModule.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
 
module WithInParModule (A : Set) where
2
 
 
3
 
data Nat : Set where
4
 
  zero : Nat
5
 
  suc  : Nat -> Nat
6
 
 
7
 
data Bool : Set where
8
 
  true : Bool
9
 
  false : Bool
10
 
 
11
 
isZero : Nat -> Bool
12
 
isZero zero = true
13
 
isZero (suc _) = false
14
 
 
15
 
 
16
 
f : Nat -> Nat
17
 
f n with isZero n
18
 
f n | true = zero
19
 
f n | false = suc zero
20
 
 
21
 
g : Nat -> Nat
22
 
g zero = zero
23
 
g (suc n) with g n
24
 
g (suc n) | zero  = n
25
 
g (suc n) | suc _ = n
26
 
 
27
 
data T : Set where
28
 
  tt : T
29
 
 
30
 
module A (x : T) where
31
 
  h : T
32
 
  h with x
33
 
  h | y = y
34
 
 
35
 
postulate
36
 
  C : T -> Set
37
 
 
38
 
test : C (A.h tt) -> C tt
39
 
test x = x
40