luau/prototyping/Luau/RuntimeType.agda

18 lines
421 B
Agda
Raw Normal View History

module Luau.RuntimeType where
2022-03-02 18:26:58 -05:00
open import Luau.Syntax using (Value; nil; addr; number; bool; string)
data RuntimeType : Set where
function : RuntimeType
number : RuntimeType
nil : RuntimeType
boolean : RuntimeType
2022-03-02 18:26:58 -05:00
string : RuntimeType
valueType : Value RuntimeType
valueType nil = nil
valueType (addr a) = function
valueType (number n) = number
valueType (bool b) = boolean
2022-03-02 18:26:58 -05:00
valueType (string x) = string