Created
July 7, 2021 23:19
-
-
Save kaidesu/cb5f28913b92d008a451ee0610bd6713 to your computer and use it in GitHub Desktop.
Ghost type system example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Short assignment example | |
a := "hello" | |
// Type system assignment example | |
b : string = "world" | |
c : number = 123 | |
d : list[string] = ["foo", "bar"] | |
e : map{string: list[number]} = { | |
"foo": [10, 20], | |
"bar": [30, 40], | |
} | |
// Ghost's basic types are: | |
// - boolean | |
// - string | |
// - number | |
// - list | |
// - map |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment