| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Properties of operations on the Covec type |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --sized-types #-} |
| 8 |
|
| 9 |
module Codata.Sized.Covec.Properties where |
| 10 |
|
| 11 |
open import Size using (Size; ∞) |
| 12 |
open import Codata.Sized.Thunk using (Thunk; force) |
| 13 |
open import Codata.Sized.Conat using (zero; suc) |
| 14 |
open import Codata.Sized.Covec using (Covec; _∷_; []; map) |
| 15 |
open import Codata.Sized.Covec.Bisimilarity |
| 16 |
open import Function.Base using (id; _∘_) |
| 17 |
open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≡_) |
| 18 |
|
| 19 |
-- Functor laws |
| 20 |
|
| 21 |
module _ {a} {A : Set a} where |
| 22 |
|
| 23 |
map-id : ∀ {m} (as : Covec A ∞ m) {i} → i , m ⊢ map id as ≈ as |
| 24 |
map-id [] = [] |
| 25 |
map-id (a ∷ as) = ≡.refl ∷ λ where .force → map-id (as .force) |
| 26 |
|
| 27 |
module _ {a b c} {A : Set a} {B : Set b} {C : Set c} where |
| 28 |
|
| 29 |
map-∘ : ∀ (f : A → B) (g : B → C) {m} as {i} → i , m ⊢ map g (map f as) ≈ map (g ∘ f) as |
| 30 |
map-∘ f g [] = [] |
| 31 |
map-∘ f g (a ∷ as) = ≡.refl ∷ λ where .force → map-∘ f g (as .force) |
| 32 |
|
| 33 |
------------------------------------------------------------------------ |
| 34 |
-- DEPRECATED |
| 35 |
------------------------------------------------------------------------ |
| 36 |
-- Please use the new names as continuing support for the old names is |
| 37 |
-- not guaranteed. |
| 38 |
|
| 39 |
-- Version 2.0 |
| 40 |
|
| 41 |
map-identity = map-id |
| 42 |
{-# WARNING_ON_USAGE map-identity |
| 43 |
"Warning: map-identity was deprecated in v2.0. |
| 44 |
Please use map-id instead." |
| 45 |
#-} |
| 46 |
|
| 47 |
map-map-fusion = map-∘ |
| 48 |
{-# WARNING_ON_USAGE map-map-fusion |
| 49 |
"Warning: map-map-fusion was deprecated in v2.0. |
| 50 |
Please use map-∘ instead." |
| 51 |
#-} |