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

Ide.Plugin.Tactic.Judgements

Synopsis

Documentation

introducingLambda Source #

Arguments

:: Maybe OccName

The name of the top level function. For any other function, this should be Nothing.

-> [(OccName, a)] 
-> Judgement' a 
-> Judgement' a 

Introduce bindings in the context of a lamba.

introducingRecursively :: [(OccName, a)] -> Judgement' a -> Judgement' a Source #

Introduce a binding in a recursive context.

introducingPat :: Maybe OccName -> DataCon -> [(OccName, a)] -> Judgement' a -> Judgement' a Source #

Pattern vals are currently tracked in jHypothesis, with an extra piece of data sitting around in jPatternVals.

jHypothesis :: Judgement' a -> Map OccName (HyInfo a) Source #

The hypothesis, consisting of local terms and the ambient environment (impors and class methods.) Hides disallowed values.

jEntireHypothesis :: Judgement' a -> Map OccName (HyInfo a) Source #

The whole hypothesis, including things disallowed.

jPatHypothesis :: Judgement' a -> Map OccName PatVal Source #

Only the hypothesis members which are pattern vals

filterSameTypeFromOtherPositions :: DataCon -> Int -> Judgement -> Judgement Source #

Disallow any hypotheses who have the same type as anything bound by the given position for the datacon. Used to ensure recursive functions like fmap preserve the relative ordering of their arguments by eliminating any other term which might match.

jLocalHypothesis :: Judgement' a -> Map OccName (HyInfo a) Source #

Just the local hypothesis.

isPatternMatch :: Provenance -> Bool Source #

Is this a pattern match?

filterPosition :: OccName -> Int -> Judgement -> Judgement Source #

filter defn pos removes any hypotheses which are bound in defn to a position other than pos. Any terms whose ancestry doesn't include defn remain.

isTopHole :: Context -> Judgement' a -> Maybe OccName Source #

If we're in a top hole, the name of the defining function.

disallowing :: DisallowReason -> [OccName] -> Judgement' a -> Judgement' a Source #

Prevent some occnames from being used in the hypothesis. This will hide them from jHypothesis, but not from jEntireHypothesis.

mkFirstJudgement Source #

Arguments

:: Map OccName (HyInfo CType) 
-> Bool

are we in the top level rhs hole?

-> Type 
-> Judgement' CType 

hypothesisFromBindings :: RealSrcSpan -> Bindings -> Map OccName (HyInfo CType) Source #

Given a SrcSpan and a Bindings, create a hypothesis.

isTopLevel :: Provenance -> Bool Source #

Is this a top level function binding?