projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX #1364: added support for C finalizers that run as soon as the value is no longer...
[ghc-base.git]
/
Data
/
Data.hs
diff --git
a/Data/Data.hs
b/Data/Data.hs
index
7bb6e6f
..
f812c30
100644
(file)
--- a/
Data/Data.hs
+++ b/
Data/Data.hs
@@
-17,6
+17,9
@@
-- in this module were moved to the @Data.Generics.Instances@ module
-- in the @syb@ package.
--
-- in this module were moved to the @Data.Generics.Instances@ module
-- in the @syb@ package.
--
+-- For more information, please visit the new
+-- SYB wiki: <http://www.cs.uu.nl/wiki/bin/view/GenericProgramming/SYB>.
+--
--
-----------------------------------------------------------------------------
--
-----------------------------------------------------------------------------
@@
-51,6
+54,7
@@
module Data.Data (
mkIntType, -- :: String -> DataType
mkFloatType, -- :: String -> DataType
mkStringType, -- :: String -> DataType
mkIntType, -- :: String -> DataType
mkFloatType, -- :: String -> DataType
mkStringType, -- :: String -> DataType
+ mkNoRepType, -- :: String -> DataType
mkNorepType, -- :: String -> DataType
-- ** Observers
dataTypeName, -- :: DataType -> String
mkNorepType, -- :: String -> DataType
-- ** Observers
dataTypeName, -- :: DataType -> String
@@
-429,7
+433,7
@@
newtype Mp m x = Mp { unMp :: m (x, Bool) }
-- | Build a term skeleton
fromConstr :: Data a => Constr -> a
-- | Build a term skeleton
fromConstr :: Data a => Constr -> a
-fromConstr = fromConstrB undefined
+fromConstr = fromConstrB (error "Data.Data.fromConstr")
-- | Build a term and use a generic function for subterms
-- | Build a term and use a generic function for subterms
@@
-753,13
+757,20
@@
mkStringConstr dt str = case datarep dt of
------------------------------------------------------------------------------
------------------------------------------------------------------------------
--- | Constructs a non-representation for a non-presentable type
+-- | Deprecated version (misnamed)
+{-# DEPRECATED mkNorepType "Use mkNoRepType instead" #-}
mkNorepType :: String -> DataType
mkNorepType str = DataType
{ tycon = str
, datarep = NoRep
}
mkNorepType :: String -> DataType
mkNorepType str = DataType
{ tycon = str
, datarep = NoRep
}
+-- | Constructs a non-representation for a non-presentable type
+mkNoRepType :: String -> DataType
+mkNoRepType str = DataType
+ { tycon = str
+ , datarep = NoRep
+ }
-- | Test for a non-representable type
isNorepType :: DataType -> Bool
-- | Test for a non-representable type
isNorepType :: DataType -> Bool
@@
-1169,7
+1180,7
@@
tuple3Constr :: Constr
tuple3Constr = mkConstr tuple3DataType "(,,)" [] Infix
tuple3DataType :: DataType
tuple3Constr = mkConstr tuple3DataType "(,,)" [] Infix
tuple3DataType :: DataType
-tuple3DataType = mkDataType "Prelude.(,)" [tuple3Constr]
+tuple3DataType = mkDataType "Prelude.(,,)" [tuple3Constr]
instance (Data a, Data b, Data c) => Data (a,b,c) where
gfoldl f z (a,b,c) = z (,,) `f` a `f` b `f` c
instance (Data a, Data b, Data c) => Data (a,b,c) where
gfoldl f z (a,b,c) = z (,,) `f` a `f` b `f` c
@@
-1257,7
+1268,7
@@
instance (Data a, Data b, Data c, Data d, Data e, Data f, Data g)
instance Typeable a => Data (Ptr a) where
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
instance Typeable a => Data (Ptr a) where
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
- dataTypeOf _ = mkNorepType "GHC.Ptr.Ptr"
+ dataTypeOf _ = mkNoRepType "GHC.Ptr.Ptr"
------------------------------------------------------------------------------
------------------------------------------------------------------------------
@@
-1265,7
+1276,7
@@
instance Typeable a => Data (Ptr a) where
instance Typeable a => Data (ForeignPtr a) where
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
instance Typeable a => Data (ForeignPtr a) where
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
- dataTypeOf _ = mkNorepType "GHC.ForeignPtr.ForeignPtr"
+ dataTypeOf _ = mkNoRepType "GHC.ForeignPtr.ForeignPtr"
------------------------------------------------------------------------------
------------------------------------------------------------------------------
@@
-1276,5
+1287,5
@@
instance (Typeable a, Data b, Ix a) => Data (Array a b)
gfoldl f z a = z (listArray (bounds a)) `f` (elems a)
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
gfoldl f z a = z (listArray (bounds a)) `f` (elems a)
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
- dataTypeOf _ = mkNorepType "Data.Array.Array"
+ dataTypeOf _ = mkNoRepType "Data.Array.Array"