[project @ 2005-02-02 13:47:24 by simonpj]
authorsimonpj <unknown>
Wed, 2 Feb 2005 13:47:24 +0000 (13:47 +0000)
committersimonpj <unknown>
Wed, 2 Feb 2005 13:47:24 +0000 (13:47 +0000)
Generalise gfindtype to

gfindtype :: (Data x, Typeable y) => x -> Maybe y

(It was (Data x, Data y) => ..., but there's no reason to
require Data y.)

Pointed out by Jim Apple

Data/Generics/Schemes.hs

index c783d4a..5234b01 100644 (file)
@@ -157,7 +157,7 @@ gtypecount (_::a) = gcount (False `mkQ` (\(_::a) -> True))
 
 
 -- | Find (unambiguously) an immediate subterm of a given type
-gfindtype :: (Data x, Data y) => x -> Maybe y
+gfindtype :: (Data x, Typeable y) => x -> Maybe y
 gfindtype = singleton
           . foldl unJust []
           . gmapQ (Nothing `mkQ` Just)