Type Funcers

type

Gives the type of the input expression.

TypeValue
Input<A Any>any value (is ignored)
OutputStra string representation of the type of the input expression

Examples

ProgramTypeValueError
typeStr"Null"
null typeStr"Null"
true typeStr"Bool"
1 typeStr"Num"
1.5 typeStr"Num"
"abc" typeStr"Str"
for Any def f Any as null ok f typeStr"Any"
[] typeStr"Arr<>"
["dog", "cat"] typeStr"Arr<Str, Str>"
["dog", 1] typeStr"Arr<Str, Num>"
["dog", 1, {}] typeStr"Arr<Str, Num, Obj<Void>>"
["dog", 1, {}, 2] typeStr"Arr<Str, Num, Obj<Void>, Num>"
{} typeStr"Obj<Void>"
{a: null} typeStr"Obj<a: Null, Void>"
{b: false, a: null} typeStr"Obj<a: Null, b: Bool, Void>"
{c: 0, b: false, a: null} typeStr"Obj<a: Null, b: Bool, c: Num, Void>"
{d: "", c: 0, b: false, a: null} typeStr"Obj<a: Null, b: Bool, c: Num, d: Str, Void>"
{e: [], d: "", c: 0, b: false, a: null} typeStr"Obj<a: Null, b: Bool, c: Num, d: Str, e: Arr<>, Void>"
{f: {}, e: [], d: "", c: 0, b: false, a: null} typeStr"Obj<a: Null, b: Bool, c: Num, d: Str, e: Arr<>, f: Obj<Void>, Void>"
for Num def f Num|Str as if ==1 then 1 else "abc" ok ok 1 f typeStr"Num|Str"
for Any def f Num|Str as 1 ok f typeStr"Num|Str"
for Any def f Void|Num as 1 ok f typeStr"Num"
for Any def f Num|Any as 1 ok f typeStr"Any"