-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO.txt
108 lines (78 loc) · 2.95 KB
/
TODO.txt
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
write core signature
translate abbot to semio
write binary search trees in semio
- module system - expand and implement in typechecker and dynamics
- imperative features
- dependent product and function kinds
- exhaustivenss/redundancy checking
- infix and other syntax features
- low level builtins
? type inference
fn <name> : <type> => <expr> end
()
(<expr>, <expr>{, <expr>})
match <expr> with <pat> => <expr> {| <pat> => <expr>} end
let {<decl>} in <expr> end
(* <decl> = *)
val <expr-def>
| rec val <expr-def> {and <expr-def>}
| type <type-def>
| rec type <type-def> {and <type-def>}
(* <expr-def> = *)
<name> {<name> : <type>} [: <type>] = <expr>
(* <type-def> = *)
<name> {<name>} = <type>
fix <name> is <expr> end
Inj"["<type> {+ <type>}"]""["<num >= 1>"]"
<type with {'<name>}> --> Lamt '<name> -> original exp
somehow insert apt, fold, and unfold when appropriate?
<type> -> <type>
<type> * <type> {* <type>}
<type> + <type> {+ <type>}
rec <name> is <type> end
reserved symbols: , " ( ) [ ] : |
reserved words: let and in end match with Inj fn is rec val _ =>
reserved symbols in types: * +
reserved words in types: ->
modules
type classes "t -> t for all t with SHOW"
existential subtyping
classed existential types
infix operators and constructors "infix foo" "^ precedes * / precedes +"
kind system
type genericity
fancy constructors, like gadts or polymorphic constructors
extension of new type features to modules
pattern matching
pattern matching for types
recursive definitions
hiding
explicit typing
abstract type fields in declarations
extensible types and kinds
type inference
mutables
value restriction?
kind list = fn a b => a -> (b -> a -> a) -> a
type nil : forall a b. list a b = fn n c => n
type cons : forall a b. b -> list a b -> list a b = fn b l n c => c b (l n c)
type recur : forall a b. list a b -> a -> (b -> a -> a) -> a = fn n => n
type prod : list type type -> type = fn l => recur l unit ( * )
val zipn : forall l : list (list type type) type.
prod (recur args unit (fn (x, acc) => list x :: acc))
-> list (prod (recur args unit (fn (x, acc) => x :: acc)))
val unzipn : forall l : list type.
list (prod l)
-> prod (recur args unit (fn (x, acc) => list x :: acc))
repeat_until_finished:
We can have this as a language primitive. Here's some decent syntax:
with p = e loop
e'
end loop
where p is a pattern for the loop state, and e is the initial value.
All tail positions of e' must be either "repeat e" or "exit e" (or continue, break or something
else...). This is a little more restricted than the function version of ruf, but that let's us
provide an efficient implementation. Maybe we can do something fancy in the type system to allow a
tailcall to a function that itself satisfies this property? That might be doable with modes.
Maybe "init" can replace "with", to emphasize that e is merely the initial value of p, and to
avoid any other associations folks might have with "with".