packages feed

syb-with-class 0.1 → 0.2

raw patch · 4 files changed

+25/−5 lines, 4 files

Files

Data/Generics/SYB/WithClass/Basics.hs view
@@ -1,4 +1,5 @@-{-# LANGUAGE UndecidableInstances, OverlappingInstances, Rank2Types #-}+{-# LANGUAGE UndecidableInstances, OverlappingInstances, Rank2Types,+    CPP #-}  {- @@ -20,8 +21,11 @@ import Data.Typeable import Data.Generics.SYB.WithClass.Context -+#ifdef __HADDOCK__+data Proxy+#else data Proxy (a :: * -> *)+#endif  ------------------------------------------------------------------------------ -- The ingenious Data class
Data/Generics/SYB/WithClass/Derive.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TemplateHaskell, CPP #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} -- We can't warn about missing sigs as we have a group of decls in -- quasi-quotes that we're going to put in a class instance@@ -37,6 +37,9 @@ --   it has and creates a Typeable instance for it. deriveTypeablePrim :: Name -> Int -> Q [Dec] deriveTypeablePrim name nParam+#ifdef __HADDOCK__+ = undefined+#else   | nParam <= maxTypeParams =      sequence       [ instanceD (return [])@@ -54,6 +57,7 @@     typeOfName       | nParam == 0  = mkName "typeOf"       | otherwise    = mkName ("typeOf" ++ show nParam)+#endif  -- -- | Takes a name of a algebraic data type, the number of parameters it@@ -65,6 +69,9 @@ --   Doesn't do gunfold, dataCast1 or dataCast2 deriveDataPrim :: Name -> [Type] -> [(Name, Int)] -> [(Name, [(Maybe Name, Type)])] -> Q [Dec] deriveDataPrim name typeParams cons terms =+#ifdef __HADDOCK__+ undefined+#else   do sequence (       conDecs ++ @@ -153,9 +160,13 @@           mkSel (c,n) e = match  (conP c $ replicate n wildP)                          (normalB e) []+#endif  deriveMinimalData :: Name -> Int  -> Q [Dec] deriveMinimalData name nParam  = do+#ifdef __HADDOCK__+ undefined+#else    decs <- qOfDecs    let listOfDecQ = map return decs    sequence@@ -175,6 +186,7 @@                             show (typeOf x))            gfoldl _ z x = z x         |]+#endif  {- instance Data NameSet where    gunfold _ _ _ = error ("gunfold not implemented")
Data/Generics/SYB/WithClass/Instances.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE TemplateHaskell, FlexibleInstances,-             UndecidableInstances, OverlappingInstances #-}+             UndecidableInstances, OverlappingInstances, CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} -- This is a module full of or[hans, so don't warn about them @@ -535,7 +535,9 @@   -- INSTANCE_TYPEABLE0(DataType,dataTypeTc,"DataType")+#ifndef __HADDOCK__ $(deriveTypeable [''DataType])+#endif  instance Sat (ctx DataType) =>          Data ctx DataType where
syb-with-class.cabal view
@@ -1,5 +1,5 @@ Name:               syb-with-class-Version:            0.1+Version:            0.2 License:            BSD3 Copyright:          2004 - 2007 The University of Glasgow, CWI,                                 Simon Peyton Jones, Ralf Laemmel,@@ -20,5 +20,7 @@     Data.Generics.SYB.WithClass.Context     Data.Generics.SYB.WithClass.Derive     Data.Generics.SYB.WithClass.Instances+Extensions: UndecidableInstances, OverlappingInstances, Rank2Types,+            EmptyDataDecls, TemplateHaskell, FlexibleInstances, CPP GHC-Options: -Wall -Werror