hls-tactics-plugin-1.0.0.0: Wingman plugin for Haskell Language Server
Safe HaskellNone
LanguageHaskell2010

Ide.Plugin.Tactic.GHC

Synopsis

Documentation

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.

freshTyvars :: MonadState TacticState m => Type -> m Type Source #

Instantiate all of the quantified type variables in a type with fresh skolems.

getRecordFields :: DataCon -> Maybe [(OccName, CType)] Source #

Given a datacon, extract its record fields' names and types. Returns nothing if the datacon is not a record.

algebraicTyCon :: Type -> Maybe TyCon Source #

Is this an algebraic type?

eqRdrName :: RdrName -> RdrName -> Bool Source #

We can't compare RdrName for equality directly. Instead, compare them by their OccNames.

containsHsVar :: Data a => RdrName -> a -> Bool Source #

Does this thing contain any references to HsVars with the given RdrName?

containsHole :: Data a => a -> Bool Source #

Does this thing contain any holes?

isHole :: OccName -> Bool Source #

Check if an OccName is a hole

allOccNames :: Data a => a -> Set OccName Source #

Get all of the referenced occnames.

pattern Lambda :: [Pat GhcPs] -> HsExpr GhcPs -> HsExpr GhcPs Source #

A pattern over the otherwise (extremely) messy AST for lambdas.

pattern UnguardedRHSs :: HsExpr GhcPs -> GRHSs GhcPs (LHsExpr GhcPs) Source #

A GRHS that caontains no guards.

pattern SinglePatMatch :: Pat GhcPs -> HsExpr GhcPs -> Match GhcPs (LHsExpr GhcPs) Source #

A match with a single pattern. Case matches are always SinglePatMatches.

unpackMatches :: [Match GhcPs (LHsExpr GhcPs)] -> Maybe [(Pat GhcPs, HsExpr GhcPs)] Source #

Helper function for defining the Case pattern.

pattern Case :: HsExpr GhcPs -> [(Pat GhcPs, HsExpr GhcPs)] -> HsExpr GhcPs 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

type PatCompat pass = LPat pass Source #

pattern TopLevelRHS :: OccName -> [PatCompat GhcTc] -> LHsExpr GhcTc -> Match GhcTc (LHsExpr GhcTc) Source #

Should make sure it's a fun bind

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.