HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulepolysemy-plugin-0.4.5.2Haskell2010

Polysemy.Plugin.Fundep.Unification

  • 3 types
  • 4 values
datadata SolveContext
#

The context in which we're attempting to solve a constraint.

Constructors

  • FunctionDef (Set TyVar)

    In the context of a function definition. The Set TyVar is all of the skolems that exist in the [G] constraints for this function.

  • InterpreterUse Bool (Set TyVar)

    In the context of running an interpreter. The Bool corresponds to whether we are only trying to solve a single Member constraint right now. If so, we *must* produce a unification wanted.

Instances3Eq, Ord, Outputable
  • Eq SolveContextDefined in polysemy-plugin-0.4.5.2 · Polysemy.Plugin.Fundep.Unification
  • Ord SolveContextDefined in polysemy-plugin-0.4.5.2 · Polysemy.Plugin.Fundep.Unification
  • Outputable SolveContextDefined in polysemy-plugin-0.4.5.2 · Polysemy.Plugin.Fundep.Unification
valuemustUnify :: SolveContext -> Bool
#

Depending on the context in which we're solving a constraint, we may or may not want to force a unification of effects. For example, when defining user code whose type is Member (State Int) r => ..., if we see get :: Sem r s, we should unify s ~ Int.

valueunify
  1. :: SolveContext
  2. -> Type

    wanted

  3. -> Type

    given

  4. -> Maybe Subst
#

Determine whether or not two effects are unifiable.

All free variables in [W] constraints are considered skolems, and thus are not allowed to unify with anything but themselves. This properly handles all cases in which we are unifying ambiguous [W] constraints (which are true type variables) against [G] constraints.

newtypenewtype OrdType
#

Types don't have Eq or Ord instances by default, even though there are functions in GHC that implement these operations. This newtype gives us those instances.

Constructors

Instances2Eq, Ord
  • Eq OrdTypeDefined in polysemy-plugin-0.4.5.2 · Polysemy.Plugin.Fundep.Unification
  • Ord OrdTypeDefined in polysemy-plugin-0.4.5.2 · Polysemy.Plugin.Fundep.Unification