KtorZ
858dfccc82
Authorize complete patterns as function args.
...
This is mainly a syntactic trick/sugar, but it's been pretty annoying
to me for a while that we can't simply pattern-match/destructure
single-variant constructors directly from the args list. A classic
example is when writing property tests:
```ak
test foo(params via both(bytearray(), int())) {
let (bytes, ix) = params
...
}
```
Now can be replaced simply with:
```
test foo((bytes, ix) via both(bytearray(), int())) {
...
}
```
If feels natural, especially coming from the JavaScript, Haskell or
Rust worlds and is mostly convenient. Behind the scene, the compiler
does nothing more than re-writing the AST as the first form, with
pre-generated arg names. Then, we fully rely on the existing
type-checking capabilities and thus, works in a seamless way as if we
were just pattern matching inline.
2024-06-07 15:42:25 +02:00
..
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-05-22 15:46:32 -04:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-03-09 20:44:51 +01:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-05-22 15:46:32 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2023-09-13 18:17:40 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-01-20 10:44:16 +01:00
2024-05-22 15:46:32 -04:00
2023-09-13 18:17:40 -04:00
2024-05-22 15:46:32 -04:00
2024-05-04 14:04:12 -04:00
2023-09-13 18:17:40 -04:00
2023-09-25 21:16:19 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-06 15:17:01 -04:00
2024-01-20 10:44:16 +01:00
2024-05-23 16:45:40 +02:00
2024-01-20 10:44:16 +01:00
2024-05-22 15:46:32 -04:00
2023-09-13 18:17:40 -04:00
2023-09-13 18:17:40 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-02-13 21:29:46 -05:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-01-20 10:38:40 +01:00
2024-01-20 10:38:40 +01:00
2024-03-04 10:52:56 -05:00
2024-02-25 14:09:56 -05:00
2024-03-04 11:48:22 -05:00
2024-05-22 15:46:32 -04:00
2024-03-08 12:25:26 -05:00
2024-03-09 20:44:51 +01:00
2024-03-27 15:52:23 -04:00
2024-05-06 15:17:01 -04:00
2024-05-22 15:46:32 -04:00
2024-05-22 15:46:32 -04:00
2024-05-21 11:56:12 -04:00
2024-06-07 15:42:25 +02:00
2024-05-22 15:46:32 -04:00
2022-12-21 14:39:46 -05:00
2024-05-04 14:04:12 -04:00
2023-02-09 00:57:14 -05:00
2023-02-09 00:57:14 -05:00
2023-03-16 23:04:24 +01:00
2022-12-29 12:11:55 +01:00