Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- tcTyVar_maybe :: Type -> Maybe Var
- instantiateType :: Type -> ([TyVar], Type)
- cloneTyVar :: TyVar -> TyVar
- isFunction :: Type -> Bool
- tacticsSplitFunTy :: Type -> ([TyVar], ThetaType, [Type], Type)
- tacticsThetaTy :: Type -> ThetaType
- tacticsGetDataCons :: Type -> Maybe ([DataCon], [Type])
- freshTyvars :: MonadState TacticState m => Type -> m Type
- getRecordFields :: ConLike -> Maybe [(OccName, CType)]
- algebraicTyCon :: Type -> Maybe TyCon
- eqRdrName :: RdrName -> RdrName -> Bool
- sloppyEqOccName :: OccName -> OccName -> Bool
- containsHsVar :: Data a => RdrName -> a -> Bool
- containsHole :: Data a => a -> Bool
- isHole :: OccName -> Bool
- allOccNames :: Data a => a -> Set OccName
- pattern AMatch :: HsMatchContext (NameOrRdrName (IdP GhcPs)) -> [Pat GhcPs] -> HsExpr GhcPs -> Match GhcPs (LHsExpr GhcPs)
- pattern Lambda :: [Pat GhcPs] -> HsExpr GhcPs -> HsExpr GhcPs
- pattern UnguardedRHSs :: LHsExpr p -> GRHSs p (LHsExpr p)
- pattern SinglePatMatch :: PatCompattable p => Pat p -> LHsExpr p -> Match p (LHsExpr p)
- unpackMatches :: PatCompattable p => [Match p (LHsExpr p)] -> Maybe [(Pat p, LHsExpr p)]
- pattern Case :: PatCompattable p => HsExpr p -> [(Pat p, LHsExpr p)] -> HsExpr p
- lambdaCaseable :: Type -> Maybe Bool
- class PatCompattable p where
- fromPatCompat :: PatCompat p -> Pat p
- toPatCompat :: Pat p -> PatCompat p
- type PatCompat pass = LPat pass
- pattern TopLevelRHS :: OccName -> [PatCompat GhcTc] -> LHsExpr GhcTc -> Match GhcTc (LHsExpr GhcTc)
- dataConExTys :: DataCon -> [TyCoVar]
- unXPat :: Pat GhcPs -> Pat GhcPs
- knownThings :: TcGblEnv -> HscEnvEq -> MaybeT IO KnownThings
- knownClass :: TcGblEnv -> HscEnvEq -> OccName -> MaybeT IO Class
- knownThing :: (TyThing -> Maybe a) -> TcGblEnv -> HscEnvEq -> OccName -> MaybeT IO a
- liftMaybe :: Monad m => Maybe a -> MaybeT m a
Documentation
cloneTyVar :: TyVar -> TyVar Source #
isFunction :: Type -> Bool Source #
Is this a function type?
tacticsSplitFunTy :: Type -> ([TyVar], ThetaType, [Type], Type) Source #
Split a function, also splitting out its quantified variables and theta context.
tacticsThetaTy :: Type -> ThetaType Source #
Rip the theta context out of a regular type.
tacticsGetDataCons :: Type -> Maybe ([DataCon], [Type]) Source #
Get the data cons of a type, if it has any.
freshTyvars :: MonadState TacticState m => Type -> m Type Source #
Instantiate all of the quantified type variables in a type with fresh skolems.
getRecordFields :: ConLike -> Maybe [(OccName, CType)] Source #
Given a datacon, extract its record fields' names and types. Returns nothing if the datacon is not a record.
sloppyEqOccName :: OccName -> OccName -> Bool Source #
Compare two OccName
s for unqualified equality.
containsHole :: Data a => a -> Bool Source #
Does this thing contain any holes?
pattern AMatch :: HsMatchContext (NameOrRdrName (IdP GhcPs)) -> [Pat GhcPs] -> HsExpr GhcPs -> Match GhcPs (LHsExpr GhcPs) Source #
Unpack the relevant parts of a Match
pattern Lambda :: [Pat GhcPs] -> HsExpr GhcPs -> HsExpr GhcPs Source #
A pattern over the otherwise (extremely) messy AST for lambdas.
pattern SinglePatMatch :: PatCompattable p => Pat p -> LHsExpr p -> Match p (LHsExpr p) Source #
A match with a single pattern. Case matches are always SinglePatMatch
es.
unpackMatches :: PatCompattable p => [Match p (LHsExpr p)] -> Maybe [(Pat p, LHsExpr p)] Source #
Helper function for defining the Case
pattern.
pattern Case :: PatCompattable p => HsExpr p -> [(Pat p, LHsExpr p)] -> HsExpr p Source #
A pattern over the otherwise (extremely) messy AST for lambdas.
lambdaCaseable :: Type -> Maybe Bool Source #
Can ths type be lambda-cased?
Return: Nothing
if no
Just False
if it can't be homomorphic
Just True
if it can
class PatCompattable p where Source #
fromPatCompat :: PatCompat p -> Pat p Source #
toPatCompat :: Pat p -> PatCompat p Source #
Instances
PatCompattable GhcPs Source # | |
Defined in Wingman.GHC | |
PatCompattable GhcTc Source # | |
Defined in Wingman.GHC |
pattern TopLevelRHS :: OccName -> [PatCompat GhcTc] -> LHsExpr GhcTc -> Match GhcTc (LHsExpr GhcTc) Source #
Should make sure it's a fun bind
dataConExTys :: DataCon -> [TyCoVar] Source #
unXPat :: Pat GhcPs -> Pat GhcPs Source #
In GHC 8.8, sometimes patterns are wrapped in XPat
.
The nitty gritty details are explained at
https://blog.shaynefletcher.org/2020/03/ghc-haskell-pats-and-lpats.html
We need to remove these in order to succesfull find patterns.
knownThings :: TcGblEnv -> HscEnvEq -> MaybeT IO KnownThings Source #
Build a KnownThings
.
knownClass :: TcGblEnv -> HscEnvEq -> OccName -> MaybeT IO Class Source #
Like knownThing
but specialized to classes.