unknownTerm :: Var v => ErrorExtractor v loc (loc, v, [C.Suggestion v loc], C.Type v loc)
unknownTerm = cause >>= \case
  C.UnknownTerm loc v suggestions expectedType -> do
    let k = Var.Inference Var.Ability
        cleanup = Type.cleanup . Type.removePureEffects . Type.generalize' k
    pure (loc, v, suggestions, cleanup expectedType)
  _ -> mzero
unknownTerm :: Var v => ErrorExtractor v loc (loc, v, [C.Suggestion v loc], C.Type v loc)
unknownTerm = cause >>= \case
  C.UnknownTerm loc v suggestions expectedType -> do
    let k = Var.Inference Var.Ability
        cleanup = Type.cleanup . Type.removePureEffects . Type.generalize' k
    pure (loc, v, suggestions, cleanup expectedType)
  _ -> mzero
unknownTerm = cause >>= \case
  C.UnknownTerm loc v suggestions expectedType -> do
    let k = Var.Inference Var.Ability
        cleanup = Type.cleanup . Type.removePureEffects . Type.generalize' k
    pure (loc, v, suggestions, cleanup expectedType)
  _ -> mzero