[...] wants to find all the places in a legacy codebase that a variable foo is used in the conditional of an if.
the code I have is
import Language.C
import Data.Generics
import Control.Monad
import Text.Read
parseAndFindFoos :: FilePath -> IO (Either ParseError [Position])
parseAndFindFoos path = liftM (fmap findFooLocations) (parseCFilePre path)
findFooLocations input = fmap posOf (listify isIfOfInterest input)
isIfOfInterest (CIf cond _ _ _) = not (null (listify isFooIdent cond))
isFooIdent (Ident name) = (name == "foo")
how could I add an instance declaration for (Typeable Lexeme)?