File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ Non-backwards compatible changes
2424Minor improvements
2525------------------
2626
27+ * The function ` Data.Irrelevant._>>=_ ` now has the correct type for a 'bind'
28+ operation of a ` Monad ` , by moving the property ` irrelevant-recompute `
29+ from ` Relation.Nullary.Recomputable ` to ` Data.Irrelevant ` as ` recompute ` ,
30+ and re-exporting it from the former module with the old name. This should
31+ be backwards compatible.
32+
2733* The function ` Data.Nat.LCG.step ` is now a manifest field of the record type
2834 ` Generator ` , as per the discussion on #2936 and upstream issues/PRs. This is
2935 consistent with a minimal API for such LCGs, and should be backwards compatible.
@@ -93,6 +99,13 @@ Deprecated names
9399 ¬∀⟶∃¬- ↦ ¬∀⇒∃¬
94100 ```
95101
102+ * In ` Data.Irrelevant ` :
103+ ``` agda
104+ λ∙⁻ : (.A → B) → Irrelevant A → B
105+ λ∙⁺ : (Irrelevant A → B) → .A → B
106+ recompute : Recomputable (Irrelevant A)
107+ ```
108+
96109* In ` Data.List.Fresh.Membership.Setoid.Properties ` :
97110 ``` agda
98111 ≈-subst-∈ ↦ ∈-resp-≈
Original file line number Diff line number Diff line change 1414module Data.Irrelevant where
1515
1616open import Level using (Level)
17+ open import Relation.Nullary.Recomputable.Core using (Recomputable)
1718
1819private
1920 variable
@@ -31,7 +32,23 @@ record Irrelevant (A : Set a) : Set a where
3132open Irrelevant public
3233
3334------------------------------------------------------------------------
34- -- Algebraic structure: Functor, Appplicative and Monad-like
35+ -- Relationship with the . modality: wrapped/unwrapped abstraction
36+
37+ λ∙⁻ : (.A → B) → Irrelevant A → B
38+ λ∙⁻ f [ a ] = f a
39+ {-# INLINE λ∙⁻ #-}
40+
41+ λ∙⁺ : (Irrelevant A → B) → .A → B
42+ λ∙⁺ f a = f [ a ]
43+ {-# INLINE λ∙⁺ #-}
44+
45+ -- Irrelevant types are Recomputable
46+
47+ recompute : Recomputable (Irrelevant A)
48+ irrelevant (recompute [ a ]) = a
49+
50+ ------------------------------------------------------------------------
51+ -- Algebraic structure: Functor, Appplicative and Monad
3552
3653map : (A → B) → Irrelevant A → Irrelevant B
3754map f [ a ] = [ f a ]
@@ -44,8 +61,8 @@ _<*>_ : Irrelevant (A → B) → Irrelevant A → Irrelevant B
4461[ f ] <*> [ a ] = [ f a ]
4562
4663infixl 1 _>>=_
47- _>>=_ : Irrelevant A → (. A → Irrelevant B) → Irrelevant B
48- [ a ] >>= f = f a
64+ _>>=_ : Irrelevant A → (A → Irrelevant B) → Irrelevant B
65+ [ a ] >>= f = recompute ( f a)
4966
5067------------------------------------------------------------------------
5168-- Other functions
Original file line number Diff line number Diff line change 99module Relation.Nullary.Recomputable where
1010
1111open import Data.Empty using (⊥)
12- open import Data.Irrelevant using (Irrelevant; irrelevant; [_])
1312open import Data.Product.Base using (_×_; _,_; proj₁; proj₂)
1413open import Level using (Level)
1514open import Relation.Nullary.Negation.Core using (¬_)
@@ -21,20 +20,17 @@ private
2120 B : Set b
2221
2322------------------------------------------------------------------------
24- -- Re-export
23+ -- Re-export core definitions
2524
2625open import Relation.Nullary.Recomputable.Core public
2726
28-
29- ------------------------------------------------------------------------
30- -- Constructions
31-
3227-- Irrelevant types are Recomputable
3328
34- irrelevant-recompute : Recomputable ( Irrelevant A)
35- irrelevant (irrelevant-recompute [ a ]) = a
29+ open import Data. Irrelevant public
30+ using () renaming (recompute to irrelevant-recompute)
3631
37- -- Corollary: so too is ⊥
32+ ------------------------------------------------------------------------
33+ -- Constructions
3834
3935⊥-recompute : Recomputable ⊥
4036⊥-recompute = irrelevant-recompute
You can’t perform that action at this time.
0 commit comments