Skip to content

Commit

Permalink
Changelog 0.9.2 (#918)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Hillerström <1827113+dhil@users.noreply.github.com>

Co-authored-by: Daniel Hillerström <1827113+dhil@users.noreply.github.com>
  • Loading branch information
frank-emrich and dhil authored Sep 21, 2020
1 parent 1e4767f commit 92ec7bf
Showing 1 changed file with 103 additions and 0 deletions.
103 changes: 103 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,106 @@
# 0.9.2

This minor release contains various bug fixes, improvements, and a **breaking**
change.

## Breaking change: Trailing semicolons are no longer permitted
The surface syntax of Links has been changed. Up until now it was possible to
end a block with a semicolon. A trailing semicolon was interpreted as
implicitly ending the block with a `()` expression. The rationale for this
change is to make the Links syntax more consistent, i.e. now all blocks must end
with an explicit expression. To sum up, previously both of the following were
allowed

```links
fun foo(x) {
bar(y);
baz(x);
}
fun foo'(x) {
bar(y);
baz(x)
}
```

Now the first form is no longer accepted. Instead you have to drop the semicolon
and either end the block with an explicit `()` or wrap the last expression in an
`ignore` application.

```links
fun foo(x) {
bar(y);
baz(x);
()
}
fun foo(x) {
bar(y);
ignore(baz(x))
}
```

A third option is to simply drop the trailing semicolon, though, this only works
as intended if the type of the last expression is `()`.


## SML-style function definitions

Links now supports "switch functions", a new syntax for defining functions in
terms of match clauses directly, similar to SML. This allows writing the
following function
```links
fun ack(_,_) switch {
case (0, n) -> n + 1
case (m, 0) -> ack(m - 1, 1)
case (m, n) -> ack(m - 1, ack(m, n - 1))
}
```
instead of the following, more verbose version:

```links
fun ack(a, b) {
switch(a, b) {
case (0, n) -> n + 1
case (m, 0) -> ack(m - 1, 1)
case (m, n) -> ack(m - 1, ack(m, n - 1))
}
}
```

Switch functions can also be anonymous, allowing function like the following:
```links
fun(_, _) switch {
case (0, n) -> 0
case (m, n) -> m + n
}
```
Note: currently switch function syntax is only supported for uncurried functions.
As switch functions have experimental status they are disabled by default. To
enable them you must set the option `switch_functions=true` in a
configuration file.
## Require OCaml 4.08

The minimum required OCaml version has been raised to 4.08.


## Miscellaneous

- Fixed a bug breaking the TODO list example (#812)
- Checkboxes and radio groups in form elements are now handled correctly (#903)
- Links supports MySQL databases again! (#858)
- Fixed a bug where the effect of `orderby` was inconsistent between database
drivers w.r.t. reversing the order of results (#858)
- Relational lenses can now be used with MySQL and Sqlite3 databases, too (#897)
- Remove setting `use_keys_in_shredding`, behaving as if it was always true (#892)
- Remove setting `query`, behaving as if it was off
(i.e., `query` behaves like `query flat`) (#892)
- Fixed a bug where regular expressions in nested queries did not work correctly
(#852)
- Implemented support for negative patterns in let bindings (#811)




# 0.9.1

This minor release contains various bug fixes and improvements.
Expand Down

0 comments on commit 92ec7bf

Please sign in to comment.