Commit 89edfee
committed
Add sugar for declaration punning
This is analogous to record (or definition or binding) punning where one
can write e.g.
x = 1;
y = 2;
xy = {x; y}; ;; same as {x = x; y = y}
Now that notation also exists for declarations.
This is motivated by the upcoming intersection like signature combination
operator `&`. Consider a `MAP` signature:
type MAP = {
type t _;
Key: ORD;
;; ...
};
With the declaration punning notation and intersection like combination, one
could write
Map (Key: ORD) :> MAP & {Key} = ;; ...
to refine the `MAP` signature.1 parent 7c69219 commit 89edfee
3 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
0 commit comments