Working on PR #2055 drew my attention to the following dependency design 'indecision', probably arising from previous large-scale refactorings:
Relation.Nullary.Decidable imports Data.Sum.Base but does not use it at all (anymore) UPDATED this non-dependency now seems to have been fixed
Data.Sum imports various ('the usual') things from Relation.Nullary.*, but all/only in the service of defining
-- Conversion back and forth with Dec
fromDec : Dec A → A ⊎ ¬ A
fromDec ( true because [p]) = inj₁ (invert [p])
fromDec (false because [¬p]) = inj₂ (invert [¬p])
toDec : A ⊎ ¬ A → Dec A
toDec (inj₁ p) = yes p
toDec (inj₂ ¬p) = no ¬p
So a question naturally arises (usual asymmetry between which module in a to*/from* scenario takes ownership of the functions) whether
- (NOCHANGE)
Data.Sum should continue to import the relevant pieces of Relation.Nullary.*
- (CHANGE) else
Relation.Nullary.Decidable (NOT or .Core? not sure about the potential dependency cycles here) should continue to import Data.Sum.Base, but also define fromDec and toDec, drastically simplifying the import list for Data.Sum
PROPOSAL: adopt the second 'CHANGE' option, on the basis that Sum is conceptually/computationally prior to Decidable (so should have 'lighter' dependencies), moreover these functions only exercise specialised instances of _⊎_
A followup question would/might then be, cf. #2058 :
- possible candidate renamings of these functions
fromDec ↦ dec⁻
toDec ↦ dec⁺
fromDec ↦ toSum
toDec ↦ fromSum
Working on PR #2055 drew my attention to the following dependency design 'indecision', probably arising from previous large-scale refactorings:
UPDATED this non-dependency now seems to have been fixedRelation.Nullary.DecidableimportsData.Sum.Basebut does not use it at all (anymore)Data.Sumimports various ('the usual') things fromRelation.Nullary.*, but all/only in the service of definingSo a question naturally arises (usual asymmetry between which module in a
to*/from*scenario takes ownership of the functions) whetherData.Sumshould continue to import the relevant pieces ofRelation.Nullary.*Relation.Nullary.Decidable(NOTor.Core? not sure about the potential dependency cycles here) shouldcontinue toimportData.Sum.Base, but also definefromDecandtoDec, drastically simplifying the import list forData.SumPROPOSAL: adopt the second 'CHANGE' option, on the basis that
Sumis conceptually/computationally prior toDecidable(so should have 'lighter' dependencies), moreover these functions only exercise specialised instances of_⊎_A followup question would/might then be, cf. #2058 :