Skip to content

Commit 5f50d0f

Browse files
committed
chore: Fix haddocks.
1 parent b80a3fd commit 5f50d0f

1 file changed

Lines changed: 26 additions & 7 deletions

File tree

main/12-TypeUniverses.hs

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,35 @@
55

66
-- | Martin-Löf Type Theory with cumulative universes.
77
--
8-
-- Extends module 11 (MLTT) by replacing the inconsistent @Type : Type@ rule
9-
-- with a cumulative universe hierarchy @Type 0 : Type 1 : Type 2 : ...@.
8+
-- Extends module 11 (MLTT) by replacing the inconsistent
9+
-- @Type : Type@ rule with a cumulative universe hierarchy
10+
-- @Type 0 : Type 1 : Type 2 : ...@.
1011
--
11-
-- Types and terms still share a single syntax, core IR, and semantic domain.
12+
-- Types and terms still share a single syntax, core IR,
13+
-- and semantic domain.
1214
--
13-
-- Russell-style universes (types are their own codes, no separate @El@
14-
-- decoding). Cumulativity means @Type n@ is a subtype of @Type m@ when @n <=
15-
-- m@.
15+
-- Russell-style universes (types are their own codes, no
16+
-- separate @El@ decoding). Cumulativity means @Type n@ is
17+
-- a subtype of @Type m@ when @n <= m@.
1618
--
17-
-- Universe levels are explicit natural numbers, no inference or polymorphism.
19+
-- Universe levels are explicit natural numbers, no
20+
-- inference or polymorphism.
21+
--
22+
-- NOTE: Compound type formers (Pi, Sigma, FuncTy, PairTy, SumTy, records, ADTs)
23+
-- have dual Synth and Check formation rules.
24+
--
25+
-- The Synth path synthesizes components, extracts their levels with
26+
-- @expectUniv@, and computes the result level via @maxLevel@.
27+
--
28+
-- The Check path pushes a goal level down to both components, with cumulativity
29+
-- handling any mismatch.
30+
--
31+
-- The Synth rules are needed because the annotation tactic synthesizes the type
32+
-- to discover its level bottom-up. Without level variables or inference, there
33+
-- is no level to push down in synth position, so the level must be computed
34+
-- from the components. With universe polymorphism (module 13), the Check rules
35+
-- may subsume the Synth rules, since a level variable can be pushed down
36+
-- instead.
1837
module Main where
1938

2039
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)