[commit: packages/pretty] master: add Generic instance to Doc (428e3f7)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 22:49:30 UTC 2015


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

On branch  : master
Link       : http://git.haskell.org/packages/pretty.git/commitdiff/428e3f74ad2b4b76a6166f58994b3f7ea0fd83e3

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

commit 428e3f74ad2b4b76a6166f58994b3f7ea0fd83e3
Author: David Terei <code at davidterei.com>
Date:   Thu Dec 25 01:35:46 2014 -0800

    add Generic instance to Doc


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

428e3f74ad2b4b76a6166f58994b3f7ea0fd83e3
 src/Text/PrettyPrint/HughesPJ.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/Text/PrettyPrint/HughesPJ.hs b/src/Text/PrettyPrint/HughesPJ.hs
index 9ed67b2..4111202 100644
--- a/src/Text/PrettyPrint/HughesPJ.hs
+++ b/src/Text/PrettyPrint/HughesPJ.hs
@@ -2,6 +2,7 @@
 {-# LANGUAGE BangPatterns #-}
 #if __GLASGOW_HASKELL__ >= 701
 {-# LANGUAGE Safe #-}
+{-# LANGUAGE DeriveGeneric #-}
 #endif
 
 -----------------------------------------------------------------------------
@@ -81,6 +82,8 @@ import Data.Function   ( on )
 import Data.Monoid     ( Monoid(mempty, mappend) )
 import Data.String     ( IsString(fromString) )
 
+import GHC.Generics
+
 -- ---------------------------------------------------------------------------
 -- The Doc calculus
 
@@ -178,6 +181,9 @@ data Doc
   | NoDoc                                            -- The empty set of documents
   | Beside Doc Bool Doc                              -- True <=> space between
   | Above Doc Bool Doc                               -- True <=> never overlap
+#if __GLASGOW_HASKELL__ >= 701
+  deriving (Generic)
+#endif
 
 {-
 Here are the invariants:



More information about the ghc-commits mailing list