hls-tactics-plugin-0.5.1.0: Tactics plugin for Haskell Language Server
Safe HaskellNone
LanguageHaskell2010

Ide.Plugin.Tactic.CodeGen

Synopsis

Documentation

countRecursiveCall :: TacticState -> TacticState Source #

Doing recursion incurs a small penalty in the score.

addUnusedTopVals :: MonadState TacticState m => Set OccName -> m () Source #

Insert some values into the unused top values field. These are subsequently removed via useOccName.

destructMatches Source #

Arguments

:: (DataCon -> Judgement -> Rule)

How to construct each match

-> Maybe OccName

Scrutinee

-> CType

Type being destructed

-> Judgement 
-> RuleM (Trace, [RawMatch]) 

mkDestructPat :: DataCon -> [OccName] -> Pat GhcPs Source #

Produces a pattern for a data con and the names of its fields.

unzipTrace :: [(Trace, a)] -> (Trace, [a]) Source #

dataConInstOrigArgTys' Source #

Arguments

:: DataCon

DataConstructor

-> [Type]

Universally quantified type arguments to a result type. It MUST NOT contain any dictionaries, coercion and existentials.

For example, for MkMyGADT :: b -> MyGADT a c, we must pass [a, c] as this argument but not b, as b is an existential.

-> [Type]

Types of arguments to the DataCon with returned type is instantiated with the second argument.

Essentially same as dataConInstOrigArgTys in GHC, but only accepts universally quantified types as the second arguments and automatically introduces existentials.

NOTE: The behaviour depends on GHC's dataConInstOrigArgTys. We need some tweaks if the compiler changes the implementation.

destruct' :: (DataCon -> Judgement -> Rule) -> OccName -> Judgement -> Rule Source #

Combinator for performing case splitting, and running sub-rules on the resulting matches.

destructLambdaCase' :: (DataCon -> Judgement -> Rule) -> Judgement -> Rule Source #

Combinator for performign case splitting, and running sub-rules on the resulting matches.

buildDataCon Source #

Arguments

:: Judgement 
-> DataCon

The data con to build

-> [Type]

Type arguments for the data con

-> RuleM (Trace, LHsExpr GhcPs) 

Construct a data con with subgoals for each field.

var' :: Var a => OccName -> a Source #

Like var, but works over standard GHC OccNames.

bvar' :: BVar a => OccName -> a Source #

Like bvar, but works over standard GHC OccNames.

mkFunc :: String -> HsExpr GhcPs Source #

Get an HsExpr corresponding to a function name.

mkVal :: String -> HsExpr GhcPs Source #

Get an HsExpr corresponding to a value name.

infixCall :: String -> HsExpr GhcPs -> HsExpr GhcPs -> HsExpr GhcPs Source #

Like op, but easier to call.

appDollar :: HsExpr GhcPs -> HsExpr GhcPs -> HsExpr GhcPs Source #

Like (@@), but uses a dollar instead of parentheses.