Skip to content

Commit b260a33

Browse files
committed
[ re #1993 ] Simplifying the dependency graph
Started with simplifying System.Console.ANSI Noticed we could take advantage of Data.Product.Base
1 parent 4fe9439 commit b260a33

File tree

43 files changed

+109
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+109
-112
lines changed

src/Algebra/Construct/LexProduct/Base.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
open import Algebra.Core using (Op₂)
1010
open import Data.Bool.Base using (true; false)
11-
open import Data.Product using (_×_; _,_)
11+
open import Data.Product.Base using (_×_; _,_)
1212
open import Relation.Binary.Core using (Rel)
1313
open import Relation.Binary.Definitions using (Decidable)
14-
open import Relation.Nullary.Decidable using (does; yes; no)
14+
open import Relation.Nullary.Decidable.Core using (does; yes; no)
1515

1616
module Algebra.Construct.LexProduct.Base
1717
{a b ℓ} {A : Set a} {B : Set b}

src/Algebra/Lattice/Properties/Semilattice.agda

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66

77
{-# OPTIONS --cubical-compatible --safe #-}
88

9-
open import Algebra.Lattice
10-
open import Algebra.Structures
11-
open import Function
12-
open import Data.Product
13-
open import Relation.Binary
9+
open import Algebra.Lattice.Bundles using (Semilattice)
10+
open import Relation.Binary.Bundles using (Poset)
1411
import Relation.Binary.Lattice as B
1512
import Relation.Binary.Properties.Poset as PosetProperties
1613

src/Codata/Sized/Cowriter.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ open import Codata.Sized.Delay using (Delay; later; now)
1616
open import Codata.Sized.Stream as Stream using (Stream; _∷_)
1717
open import Data.Unit.Base
1818
open import Data.List.Base using (List; []; _∷_)
19-
open import Data.List.NonEmpty using (List⁺; _∷_)
19+
open import Data.List.NonEmpty.Base using (List⁺; _∷_)
2020
open import Data.Nat.Base as Nat using (ℕ; zero; suc)
21-
open import Data.Product as Prod using (_×_; _,_)
21+
open import Data.Product.Base as Prod using (_×_; _,_)
2222
open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂)
2323
open import Data.Vec.Base using (Vec; []; _∷_)
2424
open import Data.Vec.Bounded.Base as Vec≤ using (Vec≤; _,_)

src/Codata/Sized/Stream.agda

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ open import Data.Nat.Base
1515
open import Data.List.Base using (List; []; _∷_)
1616
open import Data.List.NonEmpty as List⁺ using (List⁺; _∷_; _∷⁺_)
1717
open import Data.Vec.Base using (Vec; []; _∷_)
18-
open import Data.Product as P hiding (map)
19-
open import Function.Base
18+
open import Data.Product.Base as P using (Σ; _×_; _,_; <_,_>; proj₁; proj₂)
19+
open import Function.Base using (id; _∘_)
2020
open import Level using (Level)
21-
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
21+
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
2222

2323
private
2424
variable

src/Data/Bool/Properties.agda

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ open import Algebra.Lattice.Bundles
1313
import Algebra.Lattice.Properties.BooleanAlgebra as BooleanAlgebraProperties
1414
open import Data.Bool.Base
1515
open import Data.Empty
16-
open import Data.Product
17-
open import Data.Sum.Base
18-
open import Function.Base
16+
open import Data.Product.Base using (_×_; _,_; proj₁; proj₂)
17+
open import Data.Sum.Base using (_⊎_; inj₁; inj₂; [_,_])
18+
open import Function.Base using (_⟨_⟩_; const; id)
1919
open import Function.Equality using (_⟨$⟩_)
2020
open import Function.Equivalence
2121
using (_⇔_; equivalence; module Equivalence)
2222
open import Induction.WellFounded using (WellFounded; Acc; acc)
2323
open import Level using (Level; 0ℓ)
2424
open import Relation.Binary hiding (_⇔_)
2525
open import Relation.Binary.PropositionalEquality hiding ([_])
26-
open import Relation.Nullary using (ofʸ; ofⁿ; does; proof; yes; no)
27-
open import Relation.Nullary.Decidable using (True)
26+
open import Relation.Nullary.Reflects using (ofʸ; ofⁿ)
27+
open import Relation.Nullary.Decidable.Core using (True; does; proof; yes; no)
2828
import Relation.Unary as U
2929

3030
open import Algebra.Definitions {A = Bool} _≡_

src/Data/Digit.agda

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@
99
module Data.Digit where
1010

1111
open import Data.Nat.Base
12-
open import Data.Nat.Properties
13-
open import Data.Nat.Solver
12+
open import Data.Nat.Properties using (_≤?_; _<?_; ≤⇒≤′; module ≤-Reasoning; m≤m+n)
13+
open import Data.Nat.Solver using (module +-*-Solver)
1414
open import Data.Fin.Base as Fin using (Fin; zero; suc; toℕ)
1515
open import Data.Bool.Base using (Bool; true; false)
16-
open import Data.Char using (Char)
16+
open import Data.Char.Base using (Char)
1717
open import Data.List.Base
18-
open import Data.Product
18+
open import Data.Product using (∃; _,_)
1919
open import Data.Vec.Base as Vec using (Vec; _∷_; [])
2020
open import Data.Nat.DivMod
2121
open import Data.Nat.Induction
22-
open import Relation.Nullary.Decidable using (does)
23-
open import Relation.Nullary.Decidable
24-
open import Relation.Binary using (Decidable)
22+
open import Relation.Nullary.Decidable using (True; does; toWitness)
23+
open import Relation.Binary.Definitions using (Decidable)
2524
open import Relation.Binary.PropositionalEquality as P using (_≡_; refl)
26-
open import Function
25+
open import Function.Base using (_$_)
2726

2827
------------------------------------------------------------------------
2928
-- Digits

src/Data/Fin/Base.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Data.Fin.Base where
1414
open import Data.Bool.Base using (Bool; true; false; T; not)
1515
open import Data.Empty using (⊥-elim)
1616
open import Data.Nat.Base as ℕ using (ℕ; zero; suc; z≤n; s≤s; z<s; s<s; _^_)
17-
open import Data.Product as Product using (_×_; _,_; proj₁; proj₂)
17+
open import Data.Product.Base as Product using (_×_; _,_; proj₁; proj₂)
1818
open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂; [_,_]′)
1919
open import Function.Base using (id; _∘_; _on_; flip)
2020
open import Level using (0ℓ)

src/Data/List/Base.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ open import Data.Bool.Base as Bool
1717
open import Data.Fin.Base using (Fin; zero; suc)
1818
open import Data.Maybe.Base as Maybe using (Maybe; nothing; just; maybe′)
1919
open import Data.Nat.Base as ℕ using (ℕ; zero; suc; _+_; _*_ ; _≤_ ; s≤s)
20-
open import Data.Product as Prod using (_×_; _,_; map₁; map₂′)
20+
open import Data.Product.Base as Prod using (_×_; _,_; map₁; map₂′)
2121
open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂)
2222
open import Data.These.Base as These using (These; this; that; these)
2323
open import Function.Base using (id; _∘_ ; _∘′_; _∘₂_; const; flip)

src/Data/List/Fresh.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Data.List.Fresh where
1616
open import Level using (Level; _⊔_)
1717
open import Data.Bool.Base using (true; false)
1818
open import Data.Unit.Polymorphic.Base using (⊤)
19-
open import Data.Product using (∃; _×_; _,_; -,_; proj₁; proj₂)
19+
open import Data.Product.Base using (∃; _×_; _,_; -,_; proj₁; proj₂)
2020
open import Data.List.Relation.Unary.All using (All; []; _∷_)
2121
open import Data.List.Relation.Unary.AllPairs using (AllPairs; []; _∷_)
2222
open import Data.Maybe.Base as Maybe using (Maybe; just; nothing)

src/Data/List/Fresh/NonEmpty.agda

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ module Data.List.Fresh.NonEmpty where
1111
open import Level using (Level; _⊔_)
1212
open import Data.List.Fresh as List# using (List#; []; cons; fresh)
1313
open import Data.Maybe.Base using (Maybe; nothing; just)
14-
open import Data.Nat using (ℕ; suc)
15-
open import Data.Product using (_×_; _,_)
16-
open import Relation.Binary as B using (Rel)
14+
open import Data.Nat.Base using (ℕ; suc)
15+
open import Data.Product.Base using (_×_; _,_)
16+
open import Relation.Binary.Core using (Rel)
1717

1818
private
1919
variable

src/Data/List/Kleene/Base.agda

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
module Data.List.Kleene.Base where
1010

11-
open import Data.Product as Product using (_×_; _,_; map₂; map₁; proj₁; proj₂)
12-
open import Data.Nat as ℕ using (ℕ; suc; zero)
13-
open import Data.Maybe as Maybe using (Maybe; just; nothing)
14-
open import Data.Sum as Sum using (_⊎_; inj₁; inj₂)
15-
open import Level as Level using (Level)
11+
open import Data.Product.Base as Product
12+
using (_×_; _,_; map₂; map₁; proj₁; proj₂)
13+
open import Data.Nat.Base as ℕ using (ℕ; suc; zero)
14+
open import Data.Maybe.Base as Maybe using (Maybe; just; nothing)
15+
open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂)
16+
open import Level using (Level)
1617

1718
open import Algebra.Core using (Op₂)
1819
open import Function.Base

src/Data/List/NonEmpty/Base.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ open import Data.Bool.Properties using (T?)
1414
open import Data.List.Base as List using (List; []; _∷_)
1515
open import Data.Maybe.Base using (Maybe ; nothing; just)
1616
open import Data.Nat.Base as ℕ
17-
open import Data.Product as Prod using (∃; _×_; proj₁; proj₂; _,_; -,_)
17+
open import Data.Product.Base as Prod using (∃; _×_; proj₁; proj₂; _,_; -,_)
1818
open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂)
1919
open import Data.These.Base as These using (These; this; that; these)
2020
open import Data.Vec.Base as Vec using (Vec; []; _∷_)

src/Data/List/Relation/Binary/Pointwise/Base.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
module Data.List.Relation.Binary.Pointwise.Base where
1010

11-
open import Data.Product using (_×_; <_,_>)
11+
open import Data.Product.Base using (_×_; <_,_>)
1212
open import Data.List.Base using (List; []; _∷_)
13-
open import Level
13+
open import Level using (Level; _⊔_)
1414
open import Relation.Binary.Core using (REL; _⇒_)
1515

1616
private

src/Data/Maybe/Base.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ open import Level
1414
open import Data.Bool.Base using (Bool; true; false; not)
1515
open import Data.Unit.Base using (⊤)
1616
open import Data.These.Base using (These; this; that; these)
17-
open import Data.Product as Prod using (_×_; _,_)
17+
open import Data.Product.Base as Prod using (_×_; _,_)
1818
open import Function.Base
1919
open import Relation.Nullary.Reflects
2020
open import Relation.Nullary.Decidable.Core

src/Data/Nat/Show.agda

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ open import Data.List.Effectful using (module TraversableA)
1616
open import Data.Maybe.Base as Maybe using (Maybe; nothing; _<∣>_; when)
1717
import Data.Maybe.Effectful as Maybe
1818
open import Data.Nat
19-
open import Data.Product using (proj₁)
20-
open import Data.String as String using (String)
21-
open import Function.Base
19+
open import Data.Product.Base using (proj₁)
20+
open import Data.String.Base as String using (String)
21+
open import Function.Base using (_∘′_; _∘_)
2222
open import Relation.Nullary.Decidable using (True)
2323

2424
------------------------------------------------------------------------
@@ -62,7 +62,7 @@ toDecimalChars : ℕ → List Char
6262
toDecimalChars = List.map toDigitChar ∘′ toNatDigits 10
6363

6464
show : String
65-
show = String.fromList ∘ toDecimalChars
65+
show = String.fromList ∘ toDecimalChars
6666

6767
-- Arbitrary base betwen 2 & 16.
6868
-- Warning: when compiled the time complexity of `showInBase b n` is

src/Data/Product.agda

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,11 @@ private
2323
open import Data.Product.Base public
2424

2525
------------------------------------------------------------------------
26-
-- Existential quantifiers
27-
28-
: {A : Set a} (A Set b) Set (a ⊔ b)
29-
= Σ _
26+
-- Negation of existential quantifier
3027

3128
: {A : Set a} (A Set b) Set (a ⊔ b)
3229
∄ P = ¬ ∃ P
3330

34-
∃₂ : {A : Set a} {B : A Set b}
35-
(C : (x : A) B x Set c) Set (a ⊔ b ⊔ c)
36-
∃₂ C =λ a λ b C a b
37-
3831
-- Unique existence (parametrised by an underlying equality).
3932

4033
∃! : {A : Set a} (A A Set ℓ) (A Set b) Set (a ⊔ b ⊔ ℓ)

src/Data/Product/Base.agda

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ infix 2 Σ-syntax
4141

4242
syntax Σ-syntax A (λ x B) = Σ[ x ∈ A ] B
4343

44+
------------------------------------------------------------------------
45+
-- Existential quantifiers
46+
47+
: {A : Set a} (A Set b) Set (a ⊔ b)
48+
= Σ _
49+
50+
∃₂ : {A : Set a} {B : A Set b}
51+
(C : (x : A) B x Set c) Set (a ⊔ b ⊔ c)
52+
∃₂ C =λ a λ b C a b
53+
4454
------------------------------------------------------------------------
4555
-- Definition of non-dependent products
4656

src/Data/Product/Effectful/Left.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ open import Level
1818
module Data.Product.Effectful.Left
1919
{a e} (A : RawMonoid a e) (b : Level) where
2020

21-
open import Data.Product
21+
open import Data.Product.Base
2222
import Data.Product.Effectful.Left.Base as Base
2323
open import Effect.Applicative using (RawApplicative)
2424
open import Effect.Monad using (RawMonad; RawMonadT; mkRawMonad)

src/Data/Product/Effectful/Left/Base.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ open import Level
1717
module Data.Product.Effectful.Left.Base
1818
{a} (A : Set a) (b : Level) where
1919

20-
open import Data.Product using (_×_; map₂; proj₁; proj₂; <_,_>)
20+
open import Data.Product.Base using (_×_; map₂; proj₁; proj₂; <_,_>)
2121
open import Effect.Functor using (RawFunctor)
2222
open import Effect.Comonad using (RawComonad)
2323

src/Data/Product/Effectful/Right.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ open import Level
1818
module Data.Product.Effectful.Right
1919
(a : Level) {b e} (B : RawMonoid b e) where
2020

21-
open import Data.Product
21+
open import Data.Product.Base
2222
import Data.Product.Effectful.Right.Base as Base
2323
open import Effect.Applicative using (RawApplicative)
2424
open import Effect.Monad using (RawMonad; RawMonadT; mkRawMonad)

src/Data/Product/Effectful/Right/Base.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ open import Level
1717
module Data.Product.Effectful.Right.Base
1818
{b} (B : Set b) (a : Level) where
1919

20-
open import Data.Product using (_×_; map₁; proj₁; proj₂; <_,_>)
20+
open import Data.Product.Base using (_×_; map₁; proj₁; proj₂; <_,_>)
2121
open import Effect.Functor using (RawFunctor)
2222
open import Effect.Comonad using (RawComonad)
2323

src/Data/String/Base.agda

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
module Data.String.Base where
1010

11-
open import Level using (zero)
1211
open import Data.Bool.Base using (Bool; true; false)
1312
open import Data.Char.Base as Char using (Char)
1413
open import Data.List.Base as List using (List; [_]; _∷_; [])
@@ -17,13 +16,13 @@ open import Data.List.Relation.Binary.Pointwise.Base using (Pointwise)
1716
open import Data.List.Relation.Binary.Lex.Core using (Lex-<; Lex-≤)
1817
open import Data.Maybe.Base as Maybe using (Maybe)
1918
open import Data.Nat.Base using (ℕ; _∸_; ⌊_/2⌋; ⌈_/2⌉)
20-
open import Data.Product using (proj₁; proj₂)
19+
open import Data.Product.Base using (proj₁; proj₂)
2120
open import Function.Base using (_on_; _∘′_; _∘_)
22-
open import Level using (Level)
21+
open import Level using (Level; 0ℓ)
2322
open import Relation.Binary.Core using (Rel)
2423
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl)
2524
open import Relation.Unary using (Pred; Decidable)
26-
open import Relation.Nullary.Decidable using (does)
25+
open import Relation.Nullary.Decidable.Core using (does)
2726

2827
------------------------------------------------------------------------
2928
-- From Agda.Builtin: type and renamed primitives
@@ -47,17 +46,17 @@ open String public using ( String )
4746
-- Pointwise equality on Strings
4847

4948
infix 4 _≈_
50-
_≈_ : Rel String zero
49+
_≈_ : Rel String 0ℓ
5150
_≈_ = Pointwise _≡_ on toList
5251

5352
-- Lexicographic ordering on Strings
5453

5554
infix 4 _<_
56-
_<_ : Rel String zero
55+
_<_ : Rel String 0ℓ
5756
_<_ = Lex-< _≡_ Char._<_ on toList
5857

5958
infix 4 _≤_
60-
_≤_ : Rel String zero
59+
_≤_ : Rel String 0ℓ
6160
_≤_ = Lex-≤ _≡_ Char._<_ on toList
6261

6362
------------------------------------------------------------------------

src/Data/String/Unsafe.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Data.List.Base as List
1212
import Data.List.Properties as Listₚ
1313
open import Data.Maybe.Base using (maybe′)
1414
open import Data.Nat.Base using (zero; suc; _+_)
15-
open import Data.Product using (proj₂)
15+
open import Data.Product.Base using (proj₂)
1616
open import Data.String.Base
1717
open import Function.Base using (_∘′_)
1818

src/Data/Vec/Base.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ open import Data.Bool.Base using (Bool; true; false; if_then_else_)
1212
open import Data.Nat.Base
1313
open import Data.Fin.Base using (Fin; zero; suc)
1414
open import Data.List.Base as List using (List)
15-
open import Data.Product as Prod using (∃; ∃₂; _×_; _,_)
15+
open import Data.Product.Base as Prod using (∃; ∃₂; _×_; _,_)
1616
open import Data.These.Base as These using (These; this; that; these)
1717
open import Function.Base using (const; _∘′_; id; _∘_)
1818
open import Level using (Level)
1919
open import Relation.Binary.PropositionalEquality.Core using (_≡_; refl; cong)
20-
open import Relation.Nullary.Decidable using (does)
20+
open import Relation.Nullary.Decidable.Core using (does)
2121
open import Relation.Unary using (Pred; Decidable)
2222

2323
private

src/Data/Vec/Bounded/Base.agda

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@
88

99
module Data.Vec.Bounded.Base where
1010

11-
open import Level using (Level)
1211
open import Data.Nat.Base
1312
import Data.Nat.Properties as ℕₚ
1413
open import Data.List.Base as List using (List)
1514
open import Data.List.Extrema ℕₚ.≤-totalOrder
1615
open import Data.List.Relation.Unary.All as All using (All)
1716
import Data.List.Relation.Unary.All.Properties as Allₚ
1817
open import Data.List.Membership.Propositional using (mapWith∈)
19-
open import Data.Product using (∃; _×_; _,_; proj₁; proj₂)
18+
open import Data.Product.Base using (∃; _×_; _,_; proj₁; proj₂)
2019
open import Data.Vec.Base as Vec using (Vec)
2120
open import Data.These.Base as These using (These)
22-
open import Function
23-
open import Relation.Nullary
24-
open import Relation.Unary
25-
open import Relation.Binary.PropositionalEquality as P using (_≡_; refl)
21+
open import Function.Base using (_∘_; id; _$_)
22+
open import Level using (Level)
23+
open import Relation.Nullary.Decidable.Core using (recompute)
24+
open import Relation.Binary.PropositionalEquality.Core as P using (_≡_; refl)
2625

2726
private
2827
variable

src/Data/Vec/Functional.agda

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ module Data.Vec.Functional where
1818
open import Data.Fin.Base
1919
open import Data.List.Base as L using (List)
2020
open import Data.Nat.Base as ℕ using (ℕ; zero; suc; NonZero; pred)
21-
open import Data.Product using (Σ; ∃; _×_; _,_; proj₁; proj₂; uncurry)
21+
open import Data.Product.Base using (Σ; ∃; _×_; _,_; proj₁; proj₂; uncurry)
2222
open import Data.Sum.Base using (_⊎_; inj₁; inj₂; [_,_])
2323
open import Data.Vec.Base as V using (Vec)
24-
open import Function.Base
24+
open import Function.Base using (_∘_; const; flip; _ˢ_; id)
2525
open import Level using (Level)
2626

2727
infixr 5 _∷_ _++_

0 commit comments

Comments
 (0)