Skip to content

Commit

Permalink
Minor comment updates (#2303)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz authored Aug 22, 2023
1 parent da9e511 commit fa7489a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/Juvix/Compiler/Core/Language.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ type Bottom = Bottom' Info Node

{---------------------------------------------------------------------------------}

-- | `Node` is the type of nodes in the program tree. The nodes themselves
-- contain only runtime-relevant information. Runtime-irrelevant annotations
-- (including all type information) are stored in the infos associated with each
-- node.
-- | `Node` is the type of nodes in the program tree. Extra
-- annotations are stored in the infos associated with each node.
data Node
= NVar {-# UNPACK #-} !Var
| NIdt {-# UNPACK #-} !Ident
Expand Down Expand Up @@ -97,7 +95,6 @@ data Node
-- Other things we might need in the future:
-- - laziness annotations (converting these to closure/thunk creation should be
-- done further down the pipeline)
-- - neutral nodes (for evaluating open terms)

-- A node (term) is closed if it has no free variables, i.e., no de Bruijn
-- indices pointing outside the term.
Expand All @@ -111,7 +108,7 @@ data Node
-- doesn't matter much outside the evaluator. See also:
-- Juvix.Compiler.Core.Language.Value.

-- All nodes in an environment must be values.
-- | All nodes in an environment must be values.
type Env = [Node]

instance HasAtomicity Node where
Expand Down
12 changes: 7 additions & 5 deletions src/Juvix/Compiler/Core/Transformation/ComputeTypeInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import Juvix.Compiler.Core.Transformation.Base
computeNodeType :: InfoTable -> Node -> Type
computeNodeType tab = Info.getNodeType . computeNodeTypeInfo tab

-- | Computes the TypeInfo for each subnode.
-- | Computes the TypeInfo for each subnode of a well-typed node.
--
-- Assumptions:
-- 1. All binders and identifiers are decorated with correct full type information.
-- 2. All cases have at least one branch.
-- 3. No `Match` nodes.
-- 4. All inductives and function types are in universe 0.
-- 1. The node is well-typed.
-- 2. All binders and identifiers are decorated with correct full type
-- information.
-- 3. All cases have at least one branch.
-- 4. No `Match` nodes.
-- 5. All inductives and function types are in universe 0.
computeNodeTypeInfo :: InfoTable -> Node -> Node
computeNodeTypeInfo tab = umapL go
where
Expand Down

0 comments on commit fa7489a

Please sign in to comment.