Skip to content

Commit

Permalink
rename inferTop' to more descriptive inferTop1
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed May 25, 2024
1 parent 7939592 commit 6ec229b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/Disco/Interactive/Commands.hs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ handleAnn ::
REPLExpr 'CAnn ->
Sem r ()
handleAnn (Ann t) = do
(at, _) <- typecheckTop $ inferTop' t
(at, _) <- typecheckTop $ inferTop1 t
infoPretty at

------------------------------------------------------------
Expand All @@ -333,7 +333,7 @@ handleCompile ::
REPLExpr 'CCompile ->
Sem r ()
handleCompile (Compile t) = do
(at, _) <- typecheckTop $ inferTop' t
(at, _) <- typecheckTop $ inferTop1 t
infoPretty . compileTerm $ at

------------------------------------------------------------
Expand All @@ -356,7 +356,7 @@ handleDesugar ::
REPLExpr 'CDesugar ->
Sem r ()
handleDesugar (Desugar t) = do
(at, _) <- typecheckTop $ inferTop' t
(at, _) <- typecheckTop $ inferTop1 t
info $ pretty' . eraseDTerm . runDesugar . desugarTerm $ at

------------------------------------------------------------
Expand Down Expand Up @@ -805,7 +805,7 @@ tableCmd =

handleTable :: Members (Error DiscoError ': State TopInfo ': Output (Message ()) ': EvalEffects) r => REPLExpr 'CTable -> Sem r ()
handleTable (Table t) = do
(at, ty) <- inputToState . typecheckTop $ inferTop' t
(at, ty) <- inputToState . typecheckTop $ inferTop1 t
v <- mapError EvalErr . evalTerm False $ at

tydefs <- use @TopInfo (replModInfo . to allTydefs)
Expand Down
6 changes: 3 additions & 3 deletions src/Disco/Typecheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ checkModule name imports (Module es _ m docs terms) = do
(x : _) -> throw $ noLoc $ DuplicateDefns (coerce x)
[] -> do
aprops <- mapError noLoc $ checkProperties docCtx -- XXX location?
aterms <- mapError noLoc $ mapM inferTop' terms -- XXX location?
aterms <- mapError noLoc $ mapM inferTop1 terms -- XXX location?
return $ ModuleInfo name imports (map ((name .-) . getDeclName) typeDecls) docCtx aprops tyCtx tyDefnCtx defnCtx aterms es
where
getDefnName :: Defn -> Name ATerm
Expand Down Expand Up @@ -456,11 +456,11 @@ infer = typecheck Infer

-- | Top-level type inference algorithm, returning only the first
-- possible result.
inferTop' ::
inferTop1 ::
Members '[Output (Message ann), Reader TyCtx, Reader TyDefCtx, Error TCError, Fresh] r =>
Term ->
Sem r (ATerm, PolyType)
inferTop' t = NE.head <$> inferTop 1 t
inferTop1 t = NE.head <$> inferTop 1 t

-- | Top-level type inference algorithm: infer up to the requested max
-- number of possible (polymorphic) types for a term by running type
Expand Down

0 comments on commit 6ec229b

Please sign in to comment.