luau/prototyping/Examples/Type.agda
Alan Jeffrey c5477d522d
Prototyping strict mode (#399)
* First cut of strict mode

Co-authored-by: Lily Brown <lily@lily.fyi>
2022-03-02 16:02:51 -06:00

28 lines
861 B
Agda
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module Examples.Type where
open import Agda.Builtin.Equality using (_≡_; refl)
open import FFI.Data.String using (_++_)
open import Luau.Type using (nil; __; _∩_; _⇒_)
open import Luau.Type.ToString using (typeToString)
ex1 : typeToString(nil) "nil"
ex1 = refl
ex2 : typeToString(nil nil) "(nil) -> nil"
ex2 = refl
ex3 : typeToString(nil (nil nil)) "(nil) -> (nil) -> nil"
ex3 = refl
ex4 : typeToString(nil (nil (nil nil))) "((nil) -> (nil) -> nil)?"
ex4 = refl
ex5 : typeToString(nil ((nil nil) nil)) "(nil) -> ((nil) -> nil)?"
ex5 = refl
ex6 : typeToString((nil nil) (nil (nil nil))) "((nil) -> nil | (nil) -> (nil) -> nil)"
ex6 = refl
ex7 : typeToString((nil nil) ((nil (nil nil)) nil)) "((nil) -> nil | (nil) -> (nil) -> nil)?"
ex7 = refl