synthExpr :: (?globals :: Globals)
          => Ctxt TypeScheme   -- ^ Context of top-level definitions
          -> Ctxt Assumption   -- ^ Local typing context
          -> Polarity          -- ^ Polarity of subgrading
          -> Expr () ()        -- ^ Expression
          -> Checker (Type, Ctxt Assumption, Substitution, Expr () Type)

-- Hit an unfilled hole
synthExpr _ ctxt _ (Hole s _) = do
  st <- get
  let varContext = relevantSubCtxt (concatMap (freeVars . snd) ctxt) (tyVarContext st)
  throw $ HoleMessage s Nothing ctxt varContext

-- Literals can have their type easily synthesised
synthExpr :: (?globals :: Globals)
          => Ctxt TypeScheme   -- ^ Context of top-level definitions
          -> Ctxt Assumption   -- ^ Local typing context
          -> Polarity          -- ^ Polarity of subgrading
          -> Expr () ()        -- ^ Expression
          -> Checker (Type, Ctxt Assumption, Substitution, Expr () Type)
synthExpr _ ctxt _ (Hole s _) = do
  st <- get
  let varContext = relevantSubCtxt (concatMap (freeVars . snd) ctxt) (tyVarContext st)
  throw $ HoleMessage s Nothing ctxt varContext

-- Literals can have their type easily synthesised
synthExpr _ ctxt _ (Hole s _) = do
  st <- get
  let varContext = relevantSubCtxt (concatMap (freeVars . snd) ctxt) (tyVarContext st)
  throw $ HoleMessage s Nothing ctxt varContext

-- Literals can have their type easily synthesised