Rename Size.moderate to Size.big

Changed files
+10 -10
Sources
PterodactylKernel
Tests
PterodactylKernelTests
+6 -6
Sources/PterodactylKernel/Core Types/Size.swift
···
import Foundation
-
/// Pterodactyl has two sizes of small things: little and moderate. Beyond these, we have things that are not types but rather “type schemes”.
+
/// Pterodactyl has two sizes of small things: ``little(universe:)`` and ``big``. Beyond these, we have things that are not types but rather “type schemes”.
public enum Size<Universe> {
-
/// A “little” thing is something classified by a universe. Universes form a countable hierarchy.
+
/// A “little” type is something classified by a universe. Universes form a countable hierarchy.
case little(universe: Universe)
-
/// A “moderate” type is something classified by `Type`.
-
case moderate
+
/// A “big” type is something classified by `Type`.
+
case big
}
···
public static func == (lhs: Size<Universe>, rhs: Size<Universe>) -> Bool {
switch (lhs, rhs) {
case (.little, .little): true
-
case (.moderate, .moderate): true
+
case (.big, .big): true
default: false
}
}
···
func map<U>(_ f: (Universe) -> U) -> Size<U> {
switch self {
case let .little(universe: universe): .little(universe: f(universe))
-
case .moderate: .moderate
+
case .big: .big
}
}
}
+2 -2
Sources/PterodactylKernel/Smallness.swift
···
switch await type.whnf() {
// In principle the type of universes could be small, but I am worried about about the strictness of the semilattice operations. I know how to interpret them if universeType is exoNat as in 2LTT, but in that case universeType probably should not be fibrant.
-
case .universeType, .universeCodes(size: .moderate):
+
case .universeType, .universeCodes(size: .big):
throw SizeError()
case let .universeCodes(size: .little(universe: littleUniverse)):
···
func assertLeq(size1: Size<Value>, size2: Size<Value>) async throws {
switch (size1, size2) {
-
case (_, .moderate): ()
+
case (_, .big): ()
case let (.little(universe: universe1), .little(universe: universe2)):
try await assertLeq(universe1: universe1, universe2: universe2)
default:
+2 -2
Tests/PterodactylKernelTests/Size.swift
···
let analysis = LocalAnalysis()
await #expect(throws: Never.self) {
-
try await analysis.assertLeq(size1: .moderate, size2: .moderate)
+
try await analysis.assertLeq(size1: .big, size2: .big)
}
}
···
let analysis = LocalAnalysis()
await #expect(throws: LocalAnalysis.SizeError.self) {
-
try await analysis.assertLeq(size1: .moderate, size2: .little(universe: .universeZero))
+
try await analysis.assertLeq(size1: .big, size2: .little(universe: .universeZero))
}
}