Skip to content

Commit 7a47c46

Browse files
committed
Codata instances of agda#509
1 parent 7337a1c commit 7a47c46

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,12 @@ Deprecated modules
636636
Deprecated names
637637
----------------
638638

639+
* In `Codata.Guarded.Stream.Properties`:
640+
```agda
641+
map-identity ↦ map-id
642+
map-fusion ↦ map-∘
643+
```
644+
639645
* In `Data.Fin.Base`: two new, hopefully more memorable, names `↑ˡ` `↑ʳ`
640646
for the 'left', resp. 'right' injection of a Fin m into a 'larger' type,
641647
`Fin (m + n)`, resp. `Fin (n + m)`, with argument order to reflect the

src/Codata/Guarded/Stream/Properties.agda

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ map-const : (a : A) (bs : Stream B) → map (const a) bs ≈ repeat a
134134
map-const a bs .head = P.refl
135135
map-const a bs .tail = map-const a (bs .tail)
136136

137-
map-identity : (as : Stream A) map id as ≈ as
138-
map-identity as .head = P.refl
139-
map-identity as .tail = map-identity (as .tail)
137+
map-id : (as : Stream A) map id as ≈ as
138+
map-id as .head = P.refl
139+
map-id as .tail = map-id (as .tail)
140140

141-
map-fusion : (g : B C) (f : A B) as map g (map f as) ≈ map (g ∘′ f) as
142-
map-fusion g f as .head = P.refl
143-
map-fusion g f as .tail = map-fusion g f (as .tail)
141+
map- : (g : B C) (f : A B) as map g (map f as) ≈ map (g ∘′ f) as
142+
map- g f as .head = P.refl
143+
map- g f as .tail = map- g f (as .tail)
144144

145145
map-unfold : (g : B C) (f : A A × B) a
146146
map g (unfold f a) ≈ unfold (Prod.map₂ g ∘′ f) a
@@ -309,3 +309,24 @@ interleave-evens-odds : (as : Stream A) → interleave (evens as) (odds as) ≈
309309
interleave-evens-odds as .head = P.refl
310310
interleave-evens-odds as .tail .head = P.refl
311311
interleave-evens-odds as .tail .tail = interleave-evens-odds (as .tail .tail)
312+
313+
------------------------------------------------------------------------
314+
-- DEPRECATED
315+
------------------------------------------------------------------------
316+
-- Please use the new names as continuing support for the old names is
317+
-- not guaranteed.
318+
319+
-- Version 2.0
320+
321+
map-identity = map-id
322+
{-# WARNING_ON_USAGE map-identity
323+
"Warning: map-identity was deprecated in v2.0.
324+
Please use map-id instead."
325+
#-}
326+
327+
map-fusion = map-∘
328+
{-# WARNING_ON_USAGE map-fusion
329+
"Warning: map-fusion was deprecated in v2.0.
330+
Please use map-∘ instead."
331+
#-}
332+

0 commit comments

Comments
 (0)