Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Reward a = Reward a
- newtype Penalize a = Penalize a
- substCTy :: TCvSubst -> CType -> CType
- newSubgoal :: Judgement -> Rule
- runTactic :: Context -> Judgement -> TacticsM () -> Either [TacticError] RunTacticResults
- assoc23 :: (a, b, c) -> (a, (b, c))
- tracePrim :: String -> Trace
- tracing :: Functor m => String -> TacticT jdg (Trace, ext) err s m a -> TacticT jdg (Trace, ext) err s m a
- guardStructurallySmallerRecursion :: TacticState -> Maybe TacticError
- markStructuralySmallerRecursion :: MonadState TacticState m => PatVal -> m ()
- scoreSolution :: LHsExpr GhcPs -> TacticState -> [Judgement] -> (Penalize Int, Reward Bool, Penalize Int, Penalize Int, Reward Int, Penalize Int, Penalize Int)
- solutionSize :: LHsExpr GhcPs -> Int
- tryUnifyUnivarsButNotSkolems :: Set TyVar -> CType -> CType -> Maybe TCvSubst
- unify :: CType -> CType -> RuleM ()
- methodHypothesis :: PredType -> Maybe [(OccName, HyInfo CType)]
- requireConcreteHole :: TacticsM a -> TacticsM a
Documentation
Reward a |
Penalize a |
Instances
Eq a => Eq (Penalize a) Source # | |
Ord a => Ord (Penalize a) Source # | |
Defined in Ide.Plugin.Tactic.Machinery | |
Show a => Show (Penalize a) Source # | |
newSubgoal :: Judgement -> Rule Source #
Produce a subgoal that must be solved before we can solve the original goal.
:: Context | |
-> Judgement | |
-> TacticsM () | Tactic to use |
-> Either [TacticError] RunTacticResults |
Attempt to generate a term of the right type using in-scope bindings, and a given tactic.
tracing :: Functor m => String -> TacticT jdg (Trace, ext) err s m a -> TacticT jdg (Trace, ext) err s m a Source #
guardStructurallySmallerRecursion :: TacticState -> Maybe TacticError Source #
Recursion is allowed only when we can prove it is on a structurally
smaller argument. The top of the ts_recursion_stack
witnesses the smaller
pattern val.
markStructuralySmallerRecursion :: MonadState TacticState m => PatVal -> m () Source #
Mark that the current recursive call is structurally smaller, due to having been matched on a pattern value.
Implemented by setting the top of the ts_recursion_stack
.
scoreSolution :: LHsExpr GhcPs -> TacticState -> [Judgement] -> (Penalize Int, Reward Bool, Penalize Int, Penalize Int, Reward Int, Penalize Int, Penalize Int) Source #
Given the results of running a tactic, score the solutions by desirability.
TODO(sandy): This function is completely unprincipled and was just hacked together to produce the right test results.
solutionSize :: LHsExpr GhcPs -> Int Source #
Compute the number of LHsExpr
nodes; used as a rough metric for code
size.
tryUnifyUnivarsButNotSkolems :: Set TyVar -> CType -> CType -> Maybe TCvSubst Source #
Like tcUnifyTy
, but takes a list of skolems to prevent unification of.
Attempt to unify two types.
methodHypothesis :: PredType -> Maybe [(OccName, HyInfo CType)] Source #
Get the class methods of a PredType
, correctly dealing with
instantiation of quantified class types.
requireConcreteHole :: TacticsM a -> TacticsM a Source #
Run the given tactic iff the current hole contains no univars. Skolems and already decided univars are OK though.