Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor comment updates #2303

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading