From ae49d236d661e87fe2cdb8e5a1c66b9fea44d352 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 23 Feb 2008 18:33:39 +0000 Subject: [PATCH] Changed findMeta so that it would work even if the Meta data was not the first direct child of an item --- common/Metadata.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/Metadata.hs b/common/Metadata.hs index 2ef12b4..15fc2b9 100644 --- a/common/Metadata.hs +++ b/common/Metadata.hs @@ -71,8 +71,8 @@ unpackMeta s = (Nothing, s) findMeta :: (Data t, Typeable t) => t -> Meta findMeta e = case cast e of Just m -> m - Nothing -> if null metaList then emptyMeta else head metaList + Nothing -> if null (concat metaList) then emptyMeta else head (concat metaList) where - metaList = gmapQ (mkQ emptyMeta findMeta') e - findMeta' :: Meta -> Meta - findMeta' m = m + metaList = gmapQ (mkQ [] findMeta') e + findMeta' :: Meta -> [Meta] + findMeta' m = [m]