Plain source file: base/TI/TiFreeNames.hs (2002-12-10)

TiFreeNames is imported by: TI, TiContextReduction, TiSCC.

module TiFreeNames(module TiFreeNames,FreeNames(..)) where
import FreeNames
import HsIdent
import Maybe(mapMaybe)

freeTypeNames x = mapMaybe freeTypeName . freeNames $ x
freeValueNames x = mapMaybe freeValueName . freeNames $ x

freeVars x = filter isHsVar . freeValueNames $ x
freeTyvars x = filter isHsVar . freeTypeNames $ x

freeTypeName (n,ClassOrTypeNames) = Just n
freeTypeName (n,_) = Nothing

freeValueName (n,ValueNames) = Just n
freeValueName (n,_) = Nothing

-- Get the type parameters from the lhs of a type/newtype/data/class decl:
typeParams tp = [v|HsVar v<-freeTyvars tp] -- Hmm. Order?


(HTML for this module was generated on 2006-08-12. About the conversion tool.)