Agda User Manual v2.6.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . it is not necessary to give an explicit constructor to the record type Stream. Now we can use copatterns to create Streams, like one that repeats a given element a infinitely many times: repeat : {A (ys : Stream A) : Set where coinductive field hd-≡ : hd xs ≡ hd ys tl-≈ : tl xs ≈ tl ys Using copatterns we can define a pair of functions on Streams such that one returns the elements in the even positions0 码力 | 288 页 | 1.24 MB | 1 年前3
Agda User Manual v2.5.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A) (ys : Stream A) : Set where coinductive field hd- : hd xs hd ys tl- : tl xs tl ys Using copatterns we can define a pair of functions on Stream such that one returns a Stream with the elements in n) → suc m suc n The current implementation of coinductive types comes with some limitations. Copatterns Consider the following record: record Enumeration A : Set where constructor enumeration field0 码力 | 135 页 | 600.40 KB | 1 年前3
Agda User Manual v2.6.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (ys : Stream A) : Set where coinductive field hd-≡ : hd xs ≡ hd ys tl-≈ : tl xs ≈ tl ys Using copatterns we can define a pair of functions on Streams such that one returns the elements in the even positions : CoN → CoN → Set where zero : zero ≈ zero suc : ∀ {m n} → ∞ (♭ m ≈ ♭ n) → suc m ≈ suc n 3.4 Copatterns Consider the following record: record Enumeration (A : Set) : Set where constructor enumeration0 码力 | 255 页 | 1.13 MB | 1 年前3
Agda User Manual v2.6.2.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (ys : Stream A) : Set where coinductive field hd-≡ : hd xs ≡ hd ys tl-≈ : tl xs ≈ tl ys Using copatterns we can define a pair of functions on Streams such that one returns the elements in the even positions : CoN → CoN → Set where zero : zero ≈ zero suc : ∀ {m n} → ∞ (♭ m ≈ ♭ n) → suc m ≈ suc n 3.4 Copatterns Consider the following record: record Enumeration (A : Set) : Set where constructor enumeration0 码力 | 257 页 | 1.16 MB | 1 年前3
Agda User Manual v2.6.2.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (ys : Stream A) : Set where coinductive field hd-≡ : hd xs ≡ hd ys tl-≈ : tl xs ≈ tl ys Using copatterns we can define a pair of functions on Streams such that one returns the elements in the even positions : CoN → CoN → Set where zero : zero ≈ zero suc : ∀ {m n} → ∞ (♭ m ≈ ♭ n) → suc m ≈ suc n 3.4 Copatterns Consider the following record: record Enumeration (A : Set) : Set where constructor enumeration0 码力 | 255 页 | 1.14 MB | 1 年前3
Agda User Manual v2.6.1.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xs ≡ hd ys tl-≈ : tl xs ≈ tl ys 3.3. Coinduction 31 Agda User Manual, Release 2.6.1.2 Using copatterns we can define a pair of functions on Stream such that one returns a Stream with the elements in suc m ≈ suc n The current implementation of coinductive types comes with some limitations. 3.4 Copatterns Consider the following record: record Enumeration (A : Set) : Set where constructor enumeration0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.6.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . hd xs ≡ hd ys tl-≈ : tl xs ≈ tl ys 3.3. Coinduction 31 Agda User Manual, Release 2.6.1 Using copatterns we can define a pair of functions on Stream such that one returns a Stream with the elements in suc m ≈ suc n The current implementation of coinductive types comes with some limitations. 3.4 Copatterns Consider the following record: record Enumeration (A : Set) : Set where constructor enumeration0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.6.1.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xs ≡ hd ys tl-≈ : tl xs ≈ tl ys 3.3. Coinduction 31 Agda User Manual, Release 2.6.1.1 Using copatterns we can define a pair of functions on Stream such that one returns a Stream with the elements in suc m ≈ suc n The current implementation of coinductive types comes with some limitations. 3.4 Copatterns Consider the following record: record Enumeration (A : Set) : Set where constructor enumeration0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.6.1.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xs ≡ hd ys tl-≈ : tl xs ≈ tl ys 3.3. Coinduction 31 Agda User Manual, Release 2.6.1.3 Using copatterns we can define a pair of functions on Stream such that one returns a Stream with the elements in suc m ≈ suc n The current implementation of coinductive types comes with some limitations. 3.4 Copatterns Consider the following record: record Enumeration (A : Set) : Set where constructor enumeration0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.6.4.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 3.4 Copatterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . it is not necessary to give an explicit constructor to the record type Stream. Now we can use copatterns to create Streams, like one that repeats a given element a infinitely many times: repeat : {A (ys : Stream A) : Set where coinductive field hd-≡ : hd xs ≡ hd ys tl-≈ : tl xs ≈ tl ys Using copatterns we can define a pair of functions on Streams such that one returns the elements in the even positions0 码力 | 311 页 | 1.38 MB | 1 年前3
共 19 条
- 1
- 2













