[Git][ghc/ghc][master] 3 commits: Update Traversable.hs with a note about an intuitive law

Marge Bot gitlab at gitlab.haskell.org
Fri Jun 7 14:26:53 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
60db142b by code5hot at 2019-06-07T14:26:46Z
Update Traversable.hs with a note about an intuitive law
- - - - -
f11aca52 by code5hot at 2019-06-07T14:26:46Z
Used terminology from a paper. Added it as a reference.
- - - - -
13b3d45d by code5hot at 2019-06-07T14:26:46Z
remove backticks from markup - it doesn't mean what I think it means
- - - - -


1 changed file:

- libraries/base/Data/Traversable.hs


Changes:

=====================================
libraries/base/Data/Traversable.hs
=====================================
@@ -115,7 +115,12 @@ import qualified GHC.List as List ( foldr )
 -- 'Data.Functor.Compose.Compose' are from "Data.Functor.Identity" and
 -- "Data.Functor.Compose".
 --
--- (The naturality law is implied by parametricity.)
+-- 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
+-- purity law [1, p15].)
 --
 -- Instances are similar to 'Functor', e.g. given a data type
 --
@@ -140,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 #-}
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/e87b9f8731460a7d8c0b45507be2d83935683d56...13b3d45d308108da2d92b3c06b5489f41703e623

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/e87b9f8731460a7d8c0b45507be2d83935683d56...13b3d45d308108da2d92b3c06b5489f41703e623
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190607/30d305f7/attachment.html>


More information about the ghc-commits mailing list