projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
30e5d4b
)
Add comments about argument order to the definitions of gmapQ and constrFields
author
simonpj@microsoft
<unknown>
Fri, 24 Nov 2006 16:45:05 +0000
(16:45 +0000)
committer
simonpj@microsoft
<unknown>
Fri, 24 Nov 2006 16:45:05 +0000
(16:45 +0000)
Data/Generics/Basics.hs
patch
|
blob
|
history
diff --git
a/Data/Generics/Basics.hs
b/Data/Generics/Basics.hs
index
84e5838
..
e9c59f6
100644
(file)
--- a/
Data/Generics/Basics.hs
+++ b/
Data/Generics/Basics.hs
@@
-291,6
+291,8
@@
class Typeable a => Data a where
-- | A generic query that processes the immediate subterms and returns a list
-- | A generic query that processes the immediate subterms and returns a list
+ -- of results. The list is given in the same order as originally specified
+ -- in the declaratoin of the data constructors.
gmapQ :: (forall a. Data a => a -> u) -> a -> [u]
gmapQ f = gmapQr (:) [] f
gmapQ :: (forall a. Data a => a -> u) -> a -> [u]
gmapQ f = gmapQr (:) [] f
@@
-569,7
+571,9
@@
dataTypeConstrs dt = case datarep dt of
_ -> error "dataTypeConstrs"
_ -> error "dataTypeConstrs"
--- | Gets the field labels of a constructor
+-- | Gets the field labels of a constructor. The list of labels
+-- is returned in the same order as they were given in the original
+-- constructor declaration.
constrFields :: Constr -> [String]
constrFields = confields
constrFields :: Constr -> [String]
constrFields = confields