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

« back to all changes in this revision

Viewing changes to test/succeed/NamedImplicit.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 NamedImplicit where
3
 
 
4
 
postulate
5
 
  T    : Set -> Set
6
 
  map' : (A B : Set) -> (A -> B) -> T A -> T B
7
 
 
8
 
map : {A B : Set} -> (A -> B) -> T A -> T B
9
 
map = map' _ _
10
 
 
11
 
data Nat : Set where
12
 
  zero : Nat
13
 
  suc  : Nat -> Nat
14
 
 
15
 
data Bool : Set where
16
 
  true  : Bool
17
 
  false : Bool
18
 
 
19
 
id : {A : Set} -> A -> A
20
 
id x = x
21
 
 
22
 
const : {A B : Set} -> A -> B -> A
23
 
const x y = x
24
 
 
25
 
postulate
26
 
  unsafeCoerce : {A B : Set} -> A -> B
27
 
 
28
 
test1 = map {B = Nat} id
29
 
test2 = map {A = Nat} (const zero)
30
 
test3 = map {B = Bool} (unsafeCoerce {A = Nat})
31
 
test4 = map {B = Nat -> Nat} (const {B = Bool} id)
32
 
 
33
 
 
34
 
f : {A B C D : Set} -> D -> D
35
 
f {D = X} = \(x : X) -> x
36