[commit: ghc] master: Improve documentation for transform list-comps (377395e)

git at git.haskell.org git at git.haskell.org
Fri Sep 11 16:17:25 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/377395e5ddeb634f0f2bb2385c6c1f23fb7578f5/ghc

>---------------------------------------------------------------

commit 377395e5ddeb634f0f2bb2385c6c1f23fb7578f5
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Sep 11 16:23:35 2015 +0100

    Improve documentation for transform list-comps
    
    Thanks to Jeremy Gibbons for spotting the infelictity


>---------------------------------------------------------------

377395e5ddeb634f0f2bb2385c6c1f23fb7578f5
 docs/users_guide/glasgow_exts.xml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 931706b..dbf67c6 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -1887,7 +1887,12 @@ guard        Control.Monad          t1 -> m t2
 fmap         GHC.Base               forall a b. (a->b) -> n a -> n b
 mzip         Control.Monad.Zip      forall a b. m a -> m b -> m (a,b)
 </programlisting>
-The comprehension should typecheck when its desugaring would typecheck.
+The comprehension should typecheck when its desugaring would typecheck,
+except that (as discussed in <xref linkend=""/>)
+in the "then f" and "then group using f" clauses,
+when the "by b" qualifier is omitted, argument f should have a polymorphic type.
+In particular, "then Data.List.sort" and
+"then group using Data.List.group" are insufficiently polymorphic.
 </para>
 <para>
 Monad comprehensions support rebindable syntax (<xref linkend="rebindable-syntax"/>).



More information about the ghc-commits mailing list