-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
type-language.scroll
81 lines (66 loc) · 2.11 KB
/
type-language.scroll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import ../code/conceptPage.scroll
id type-language
name Type Language
appeared 2013
tags pl
conceptDescription TL (Type Language) serves to describe the used system of types, constructors, and existing functions.
fileType text
centralPackageRepositoryCount 0
reference https://core.telegram.org/mtproto/TL
lineCommentToken //
multiLineCommentTokens /* */
hasLineComments true
// A comment
hasComments true
// A comment
hasMultiLineComments true
/* A comment
*/
hasSemanticIndentation false
linguistGrammarRepo https://github.com/goodmind/language-typelanguage
firstCommit 2017
lastCommit 2018
committerCount 3
commitCount 25
sampleCount 2
example
// built-in types
int#a8509bda ? = Int;
long ? = Long;
double ? = Double;
string ? = String;
null = Null;
vector {t:Type} # [ t ] = Vector t;
coupleInt {alpha:Type} int alpha = CoupleInt<alpha>;
coupleStr {gamma:Type} string gamma = CoupleStr gamma;
/* The name of the type variable is irrelevant: "gamma" could be replaced with "alpha"
However, the combinator number will depend on the specific choice. */
intHash {alpha:Type} vector<coupleInt<alpha>> = IntHash<alpha>;
strHash {alpha:Type} (vector (coupleStr alpha)) = StrHash alpha;
intSortedHash {alpha:Type} intHash<alpha> = IntSortedHash<alpha>;
strSortedHash {alpha:Type} (strHash alpha) = StrSortedHash alpha;
// custom types
pair x:Object y:Object = Pair;
triple x:Object y:Object z:Object = Triple;
user#d23c81a3 id:int first_name:string last_name:string = User;
no_user#c67599d1 id:int = User;
group id:int title:string last_name:string = Group;
no_group = Group;
---functions---
// Maybe some built-in arithmetic functions; inverse quotes make "identifiers" out of arbitrary non-alphanumeric strings
`+` Int Int = Int;
`-` Int Int = Int;
`+` Double Double = Double;
// ...
// API functions (aka RPC functions)
getUser#b0f732d5 int = User;
getUsers#2d84d5f5 (Vector int) = Vector User;
githubLanguage Type Language
fileExtensions tl
trendingProjectsCount 0
type data
aceMode text
tmScope source.tl
aliases tl
repos 404774
semanticScholar 0