From cbb35ad6c14a8cc1c96966587c9cd1c0e5c13f89 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Sun, 22 Dec 2019 14:18:12 -0500 Subject: [PATCH] Add comments to *.Disambiguation modules Follow-up to commit d06c20376f73152e3a1346fcc208498e23046bd4. [ci skip] --- src/Data/Singletons/Prelude/Ord/Disambiguation.hs | 3 ++- .../Prelude/Semigroup/Internal/Disambiguation.hs | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Data/Singletons/Prelude/Ord/Disambiguation.hs b/src/Data/Singletons/Prelude/Ord/Disambiguation.hs index c32648f9..95666bc6 100644 --- a/src/Data/Singletons/Prelude/Ord/Disambiguation.hs +++ b/src/Data/Singletons/Prelude/Ord/Disambiguation.hs @@ -16,7 +16,8 @@ -- Stability : experimental -- Portability : non-portable -- --- TODO RGS +-- Provides aliases for 'Min' and 'Max' that do not clash with the data +-- types of the same names in Data.Singletons.Prelude.Semigroup. -- ---------------------------------------------------------------------------- diff --git a/src/Data/Singletons/Prelude/Semigroup/Internal/Disambiguation.hs b/src/Data/Singletons/Prelude/Semigroup/Internal/Disambiguation.hs index afa1ba92..4b8352a1 100644 --- a/src/Data/Singletons/Prelude/Semigroup/Internal/Disambiguation.hs +++ b/src/Data/Singletons/Prelude/Semigroup/Internal/Disambiguation.hs @@ -16,7 +16,9 @@ -- Stability : experimental -- Portability : non-portable -- --- TODO RGS +-- Provides aliases for 'All', 'Any', 'Sum', and 'Product' that do not clash +-- with the promoted functions of the same names in +-- Data.Singletons.Prelude.Foldable. -- ---------------------------------------------------------------------------- @@ -26,7 +28,11 @@ import Data.Semigroup import Data.Singletons.Prelude.Semigroup.Internal import Data.Singletons.Single --- We need these in Data.Singletons.Prelude.Foldable. +-- We need these in Data.Singletons.Prelude.Foldable, as we need to promote +-- code that simultaneously uses the All/Any/Sum/Product constructors and the +-- all/any/sum/product functions, which have clashing defunctionalization +-- symbol names. Our workaround is to simply define synonyms for +-- all/any/sum/product and use those instead. $(singletons [d| all_ :: Bool -> All all_ = All