diff --git a/common/Metadata.hs b/common/Metadata.hs index b89b472..3ef3c6b 100644 --- a/common/Metadata.hs +++ b/common/Metadata.hs @@ -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 diff --git a/common/Types.hs b/common/Types.hs index bc37c9c..12ef9cf 100644 --- a/common/Types.hs +++ b/common/Types.hs @@ -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