diff options
author | gershomb <gershomb@gmail.com> | 2022-02-06 04:29:28 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-04-01 10:33:46 +0100 |
commit | 6793a20fe0cd1f04dabad46b87e86018abf73e54 (patch) | |
tree | 5f0217647e2551f23681af804f84deac768d844f | |
parent | 43da296365ddbbb807dead5e97720504ce729660 (diff) | |
download | haskell-6793a20fe0cd1f04dabad46b87e86018abf73e54.tar.gz |
Remove wrong claim about naturality law.
This docs change removes a longstanding confusion in the Traversable
docs. The docs say "(The naturality law is implied by parametricity and
thus so is the purity law [1, p15].)". However if one reads the
reference a different "natural" law is implied by parametricity. The
naturality law given as a law here is imposed. Further, the reference
gives examples which violate both laws -- so they cannot be implied by
parametricity. This PR just removes the wrong claim.
-rw-r--r-- | libraries/base/Data/Traversable.hs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libraries/base/Data/Traversable.hs b/libraries/base/Data/Traversable.hs index 19a85d863f..70ad537ce5 100644 --- a/libraries/base/Data/Traversable.hs +++ b/libraries/base/Data/Traversable.hs @@ -1492,9 +1492,6 @@ foldMapDefault = coerce (traverse @t @(Const m) @a @()) -- -- @'traverse' 'pure' = 'pure'@ -- --- (The naturality law is implied by parametricity and thus so is the --- purity law [1, p15].) --- -- The superclass instances should satisfy the following: -- -- * In the 'Functor' instance, 'fmap' should be equivalent to traversal @@ -1513,7 +1510,7 @@ foldMapDefault = coerce (traverse @t @(Const m) @a @()) -- $also -- --- * [1] \"The Essence of the Iterator Pattern\", +-- * \"The Essence of the Iterator Pattern\", -- by Jeremy Gibbons and Bruno Oliveira, -- in /Mathematically-Structured Functional Programming/, 2006, online at -- <http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/#iterator>. |