Debian Codegraph @

src/Data/Container/Properties.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Properties of operations on containers
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 module Data.Container.Properties where
10
11 open import Data.Container.Core using (Container; map)
12 open import Data.Container.Relation.Binary.Equality.Setoid using (Eq; refl)
13 import Function.Base as F using (id; _∘′_)
14 open import Relation.Binary.Bundles using (Setoid)
15
16 module _ {s p} {C : Container s p} where
17
18 map-identity : ∀ {x e} (X : Setoid x e) xs →
19 Eq X C (map F.id xs) xs
20 map-identity X xs = refl X C
21
22 map-compose : ∀ {x y z e} {X : Set x} {Y : Set y} (Z : Setoid z e) g (f : X → Y) xs →
23 Eq Z C (map g (map f xs)) (map (g F.∘′ f) xs)
24 map-compose Z g f xs = refl Z C