From 9185a42d2848131d1272e79cf1e04430fb96b6d0 Mon Sep 17 00:00:00 2001 From: simonpj Date: Wed, 2 Feb 2005 13:47:24 +0000 Subject: [PATCH] [project @ 2005-02-02 13:47:24 by simonpj] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Generics/Schemes.hs b/Data/Generics/Schemes.hs index c783d4a..5234b01 100644 --- a/Data/Generics/Schemes.hs +++ b/Data/Generics/Schemes.hs @@ -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) -- 1.7.10.4