summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcode5hot <tristan.wibberley@gmail.com>2019-06-05 15:17:12 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-07 10:26:46 -0400
commitf11aca52b1ea47b0e3c43c1ee7a5ec8c6d061714 (patch)
tree13b01a80b4e04dbcd3fad3a4a82791e0e2384bc6
parent60db142ba2928f159a0df6fd2a7c1839addf6206 (diff)
downloadhaskell-f11aca52b1ea47b0e3c43c1ee7a5ec8c6d061714.tar.gz
Used terminology from a paper. Added it as a reference.
-rw-r--r--libraries/base/Data/Traversable.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/libraries/base/Data/Traversable.hs b/libraries/base/Data/Traversable.hs
index bdb2dc3db8..5454446bcb 100644
--- a/libraries/base/Data/Traversable.hs
+++ b/libraries/base/Data/Traversable.hs
@@ -115,13 +115,12 @@ import qualified GHC.List as List ( foldr )
-- 'Data.Functor.Compose.Compose' are from "Data.Functor.Identity" and
-- "Data.Functor.Compose".
--
--- A result of the naturality law is the intuitive generalised identity law
--- for 'traverse'
+-- A result of the naturality law is a `purity law` for 'traverse'
--
-- @'traverse' 'pure' = 'pure'@
--
-- (The naturality law is implied by parametricity and thus so is the
--- generalised identity law [reference not available, word of mouth].)
+-- purity law [1, p15].)
--
-- Instances are similar to 'Functor', e.g. given a data type
--
@@ -146,6 +145,8 @@ import qualified GHC.List as List ( foldr )
-- equivalent to traversal with a constant applicative functor
-- ('foldMapDefault').
--
+-- References:
+-- [1] The Essence of the Iterator Pattern, Jeremy Gibbons and Bruno C. d. S. Oliveira
class (Functor t, Foldable t) => Traversable t where
{-# MINIMAL traverse | sequenceA #-}