1// SPDX-FileCopyrightText: 2025 The Project Pterodactyl Developers 2// 3// SPDX-License-Identifier: MPL-2.0 4 5extension Value { 6 func whnf() async -> Value { 7 switch self { 8 case .fun, .record, .shrink, .universeZero, .universeSucc, .universeLub: self 9 case let .shift(neutral: neutral): await neutral.boundary.value().value ?? self 10 } 11 } 12} 13 14extension Value.Type_ { 15 func whnf() async -> Self { 16 switch self { 17 case .funType, .recordType, .universeCodes, .universeType: return self 18 case let .decode(size: size, code: neutral): 19 guard let code = await neutral.boundary.value().value else { return self } 20 return code.decode(size: size) 21 } 22 } 23} 24