[commit: ghc] master: Make DeriveTraversable imply DeriveFunctor/Foldable (3bdc78b)
git at git.haskell.org
git at git.haskell.org
Fri Jun 6 14:09:52 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/3bdc78b520c05706f8b66033b154c07ed021ac33/ghc
>---------------------------------------------------------------
commit 3bdc78b520c05706f8b66033b154c07ed021ac33
Author: Sjoerd Visscher <sjoerd at w3future.com>
Date: Fri Jun 6 15:24:41 2014 +0200
Make DeriveTraversable imply DeriveFunctor/Foldable
Implements #9069
>---------------------------------------------------------------
3bdc78b520c05706f8b66033b154c07ed021ac33
compiler/main/DynFlags.hs | 3 +++
docs/users_guide/glasgow_exts.xml | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 4db1d2c..5f125ef 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -2957,6 +2957,9 @@ impliedFlags
, (Opt_ImplicitParams, turnOn, Opt_FlexibleInstances)
, (Opt_JavaScriptFFI, turnOn, Opt_InterruptibleFFI)
+
+ , (Opt_DeriveTraversable, turnOn, Opt_DeriveFunctor)
+ , (Opt_DeriveTraversable, turnOn, Opt_DeriveFoldable)
]
optLevelFlags :: [([Int], GeneralFlag)]
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index d5dfa4d..ac8004f 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -3882,7 +3882,11 @@ defined in <literal>Data.Foldable</literal>.
<listitem><para> With <option>-XDeriveTraversable</option>, you can derive instances of
the class <literal>Traversable</literal>,
-defined in <literal>Data.Traversable</literal>.
+defined in <literal>Data.Traversable</literal>. Since the <literal>Traversable</literal>
+instance dictates the instances of <literal>Functor</literal> and
+<literal>Foldable</literal>, you'll probably want to derive them too, so
+<option>-XDeriveTraversable</option> implies
+<option>-XDeriveFunctor</option> and <option>-XDeriveFoldable</option>.
</para></listitem>
</itemizedlist>
You can also use a standalone deriving declaration instead
More information about the ghc-commits
mailing list