mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
WIP
This commit is contained in:
parent
02f5e21331
commit
9f6fc4a56b
2 changed files with 3 additions and 4 deletions
|
@ -1,5 +1,3 @@
|
|||
{-# OPTIONS --allow-unsolved-metas #-}
|
||||
|
||||
module Examples.Type where
|
||||
|
||||
open import Agda.Builtin.Equality using (_≡_; refl)
|
||||
|
@ -26,5 +24,5 @@ ex6 : typeToString((nil ⇒ nil) ∪ (nil ⇒ (nil ⇒ nil))) ≡ "((nil) -> nil
|
|||
ex6 = refl
|
||||
|
||||
ex7 : typeToString((nil ⇒ nil) ∪ ((nil ⇒ (nil ⇒ nil)) ∪ nil)) ≡ "((nil) -> nil | (nil) -> (nil) -> nil)?"
|
||||
ex7 = {!!}
|
||||
ex7 = refl
|
||||
|
||||
|
|
|
@ -15,12 +15,13 @@ typeToString top = "top"
|
|||
typeToString number = "number"
|
||||
typeToString (S ∪ T) with normalizeOptional(S ∪ T)
|
||||
typeToString (S ∪ T) | ((S′ ⇒ T′) ∪ nil) = "(" ++ typeToString (S′ ⇒ T′) ++ ")?"
|
||||
typeToString (S ∪ T) | (S′ ∪ nil) = "(" ++ typeToString S′ ++ "?"
|
||||
typeToString (S ∪ T) | (S′ ∪ nil) = typeToString S′ ++ "?"
|
||||
typeToString (S ∪ T) | (S′ ∪ T′) = "(" ++ typeToStringᵁ (S ∪ T) ++ ")"
|
||||
typeToString (S ∪ T) | T′ = typeToString T′
|
||||
typeToString (S ∩ T) = "(" ++ typeToStringᴵ (S ∩ T) ++ ")"
|
||||
|
||||
typeToStringᵁ (S ∪ T) = (typeToStringᵁ S) ++ " | " ++ (typeToStringᵁ T)
|
||||
typeToStringᵁ T = typeToString T
|
||||
|
||||
typeToStringᴵ (S ∩ T) = (typeToStringᴵ S) ++ " & " ++ (typeToStringᴵ T)
|
||||
typeToStringᴵ T = typeToString T
|
||||
|
|
Loading…
Add table
Reference in a new issue