Moved findMeta into the Metadata module

This commit is contained in:
Neil Brown 2007-09-18 09:50:45 +00:00
parent deef9dd209
commit 1baecd7955
2 changed files with 8 additions and 10 deletions

View File

@ -75,3 +75,11 @@ unpackMeta ('~':s) = (m, rest)
metaColumn = read cs
}
unpackMeta s = (emptyMeta, s)
-- | Find the first Meta value in some part of the AST.
findMeta :: (Data t, Typeable t) => t -> Meta
findMeta e = if null metaList then emptyMeta else head metaList
where
metaList = gmapQ (mkQ emptyMeta findMeta') e
findMeta' :: Meta -> Meta
findMeta' m = m

View File

@ -30,8 +30,6 @@ module Types
, leastGeneralSharedTypeRain
, findMeta
) where
import Control.Monad
@ -325,14 +323,6 @@ makeAbbrevAM am = am
makeConstant :: Meta -> Int -> A.Expression
makeConstant m n = A.Literal m A.Int $ A.IntLiteral m (show n)
-- | Find the first Meta value in some part of the AST.
findMeta :: (Data t, Typeable t) => t -> Meta
findMeta e = if null metaList then emptyMeta else head metaList
where
metaList = gmapQ (mkQ emptyMeta findMeta') e
findMeta' :: Meta -> Meta
findMeta' m = m
-- | Checks whether a given conversion can be done implicitly in Rain
-- Parameters are src dest
isImplicitConversionRain :: A.Type -> A.Type -> Bool