| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Agda.TypeChecking.Free.Reduce
Description
Free variable check that reduces the subject to make certain variables not free. Used when pruning metavariables in Agda.TypeChecking.MetaVars.Occurs.
Synopsis
- class (PrecomputeFreeVars a, Subst a) => ForceNotFree a
- forceNotFree :: (ForceNotFree a, Reduce a) => VarSet -> a -> ReduceM (IntMap IsFree, a)
- forceNonDep :: (Reduce a, ForceNotFree a) => a -> ReduceM (IsFree, a)
- forceNonDepSort :: Sort -> ReduceM (IsFree, Sort)
- reallyFree :: (Reduce a, ForceNotFree a) => VarSet -> a -> ReduceM (Either Blocked_ (Maybe a))
- data IsFree
- nonFreeVars :: IntMap IsFree -> VarSet
Documentation
class (PrecomputeFreeVars a, Subst a) => ForceNotFree a Source #
Minimal complete definition
forceNotFree'
Instances
forceNotFree :: (ForceNotFree a, Reduce a) => VarSet -> a -> ReduceM (IntMap IsFree, a) Source #
Try to enforce a set of variables not occurring in a given type. Returns a possibly reduced version of the type and for each of the given variables whether it is either not free, or maybe free depending on some metavariables.
forceNonDep :: (Reduce a, ForceNotFree a) => a -> ReduceM (IsFree, a) Source #
Try to force a thing to no longer depend on the zero variable Returns a possibly reduced version of the thing and whether the dependency was successfully removed (i.e. the zero variable is still free)
forceNonDepSort :: Sort -> ReduceM (IsFree, Sort) Source #
András 2026-02-24: we specialize this, because TypeChecking.Reduce imports it via the hs-boot file, and if it's not specialized there, it is impossible to specialzie by GHC.
reallyFree :: (Reduce a, ForceNotFree a) => VarSet -> a -> ReduceM (Either Blocked_ (Maybe a)) Source #
Checks if the given term contains any free variables that are in the given set of variables, possibly reducing the term in the process. Returns `Right Nothing` if there are such variables, `Right (Just v')` if there are none (where v' is the possibly reduced version of the given term) or `Left b` if the problem is blocked on a meta.