Safe Haskell | None |
---|---|
Language | Haskell2010 |
- hasConstraintKind :: Type -> Bool
- lookupTypeFromId :: (HasIdInfo' id, GhcMonad m) => id -> MaybeT m Type
- typeOrKindFromId :: HasIdInfo' id => id -> Type
- typeFromTyThing :: TyThing -> Maybe Type
- lookupTypeFromGlobalName :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Type
- lookupTypeSynRhs :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Type
- lookupSynDef :: TyThing -> Maybe TyCon
- tyconFromTyThing :: TyThing -> Maybe TyCon
- tyconFromGHCType :: Type -> Maybe TyCon
- isNewtype :: GhcMonad m => Type -> m Bool
- lookupType :: GhcMonad m => Type -> MaybeT m TyThing
- lookupClassWith :: GhcMonad m => (a -> MaybeT m Name) -> a -> MaybeT m Class
- lookupClassFromInstance :: GhcMonad m => InstanceHead -> MaybeT m Class
- lookupClassFromDeclHead :: GhcMonad m => DeclHead -> MaybeT m Class
- semanticsTypeSynRhs :: GhcMonad m => Type -> MaybeT m Type
- semanticsType :: GhcMonad m => Type -> MaybeT m Type
- nameFromType :: Type -> Maybe Name
- isNewtypeTyCon :: TyThing -> Bool
- isVanillaDataConNameM :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Bool
Documentation
hasConstraintKind :: Type -> Bool Source #
lookupTypeFromId :: (HasIdInfo' id, GhcMonad m) => id -> MaybeT m Type Source #
Looks up the Type of an entity with an Id of any locality. If the entity being scrutinised is a type variable, it fails.
typeOrKindFromId :: HasIdInfo' id => id -> Type Source #
Looks up the Type or the Kind of an entity that has an Id. Note: In some cases we only get the Kind of the Id (e.g. for type constructors)
lookupTypeFromGlobalName :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Type Source #
Looks up a GHC Type from a Haskell Tools Name (given the name is global) For an identifier, it returns its type. For a data constructor, it returns its type. For a pattern synonym, it returns its builder's type. For a type synonym constructor, it returns its right-hand side. For a coaxiom, it fails.
lookupTypeSynRhs :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Type Source #
Looks up the right-hand side (GHC representation) of a Haskell Tools Name corresponding to a type synonym
lookupClassWith :: GhcMonad m => (a -> MaybeT m Name) -> a -> MaybeT m Class Source #
Looks up a GHC.Class from something that has a type class constructor in it Fails if the argument does not contain a class type constructor
lookupClassFromInstance :: GhcMonad m => InstanceHead -> MaybeT m Class Source #
semanticsTypeSynRhs :: GhcMonad m => Type -> MaybeT m Type Source #
Looks up the right-hand side (GHC representation) of a Haskell Tools Type corresponding to a type synonym
semanticsType :: GhcMonad m => Type -> MaybeT m Type Source #
Converts a global Haskell Tools type to a GHC type
nameFromType :: Type -> Maybe Name Source #
Extracts the name of a type In case of a type application, it finds the type being applied
isNewtypeTyCon :: TyThing -> Bool Source #
isVanillaDataConNameM :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Bool Source #
Decides whether a given name is a standard Haskell98 data constructor. Fails if not given a proper name.