You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Koka is a strongly typed functional-style language with effect types and handlers --
4
+
generating direct C code without needing a runtime system.
5
+
6
+
# Samples Overview
7
+
The Koka compiler (which should automatically prompt for install) comes with a set of samples to walk you through the language.
8
+
9
+
If you need help installing see [these instructions](https://koka-lang.github.io/koka/doc/book.html#install).
10
+
11
+
## Just Learning
12
+
Start by opening the [samples](command:koka.openSamples).
13
+
14
+
To start learning about Koka's features we recommend going through the `learn` folder in the following order:
15
+
16
+
1. basic
17
+
2. qualifiers
18
+
3. implicits
19
+
4. with
20
+
5. handler
21
+
6. fip
22
+
7. contexts
23
+
8. lazycons (new!)
24
+
25
+
Read through and run the samples using the code actions.
26
+
27
+
Feel free to edit the samples to try out things.
28
+
However, note that new extension / compiler versions will install new samples, and you will lose your work.
29
+
30
+
## Next Steps
31
+
32
+
If wanting to see more algorithmic examples open the basic folder.
33
+
34
+
If you want to learn more about Koka's effect handlers go to the handlers folder next.
35
+
36
+
Recommended ordering for handlers samples:
37
+
38
+
1. yield
39
+
2. basic
40
+
3. ambient
41
+
4. scoped / parser
42
+
5. nim
43
+
6. unix
44
+
7. vec
45
+
46
+
Then to get even more advanced, look at the samples for named handlers in `handlers/named` in the following order:
47
+
48
+
1. file
49
+
2. file-scoped
50
+
3. ask
51
+
4. ask-poly
52
+
5. heap
53
+
6. unify
54
+
55
+
56
+
For a more thorough reference see the [book](https://koka-lang.github.io/koka/doc/book.html), or library [docs](https://koka-lang.github.io/koka/doc/toc.html)
Copy file name to clipboardExpand all lines: whatsnew.md
+39-6Lines changed: 39 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,22 +11,55 @@ generating direct C code without needing a runtime system. To learn more:
11
11
12
12
* Read the [Koka book][kokabook] for a tour of the Koka language and its specification.
13
13
14
+
* See the new [VSCode walkthrough](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22koka.language-koka%23getting-started%22%7D) for recommended learning paths.
15
+
16
+
* Execute the [`Koka: Open Samples`][samples] command in VSCode to open the samples.
17
+
14
18
### v3.1.3, 2025-01-22
15
19
16
-
- Fix optimized compilation from VS Code (which defaulted to lower optimization before)
20
+
**New features:**
17
21
18
-
- Add applier syntax `.()` where `x.f.(42)` is sugar for `(x.f)(42)` which
22
+
- Allow passing named arguments anywhere in the argument list (i.e. `f(name = "Tim") fn() ...` now works!) [#491](https://github.com/koka-lang/koka/pull/491)
23
+
- New applier syntax `.()` where `x.f.(42)` is sugar for `(x.f)(42)` which
19
24
can be convenient when calling functions selected from a `struct`.
25
+
- Added lazy constructors! See the new `learn/lazycons.kk` sample, thanks @anfelor.
26
+
- Functions that take optional parameters are eta-expanded when resolving implicits
27
+
- Operators are now allowed as field names.
28
+
- Named handlers now have the type `ev<named-eff>` rather than just plain `named-eff`.
29
+
- Local variables are now automatically masked in more cases.
20
30
21
-
- Improve Windows installation, check clang version and Windows build tools.
31
+
**Syntax Updates:**
22
32
23
33
- Declare reference types as `reference type` (instead of `ref type`).
24
34
All types are by default reference types except for enumerations (all singleton) or
25
35
isomorphic types (single constructor with one field, i.e. a `newtype`).
26
-
27
36
- Declare divergent types as `div type/effect` (instead of `rec type/effect`).
28
37
29
-
- Various bug fixes.
38
+
**Std Library:**
39
+
40
+
- New type `core/types/pad` for usage in fbip algorithms
41
+
- New parser combinators `sep-by` and `sep-by1` thanks @toh995[#681](https://github.com/koka-lang/koka/pull/681)
42
+
- Added module information to the `core/maybe/unjust` function and an `core/maybe/expect` function that takes an error. Similarly for `maybe2`[$658](https://github.com/koka-lang/koka/pull/658).
43
+
-`core/debug/impossible` lets you throw an uncatchable exception (abort) when in an unreachable match case.
44
+
45
+
**Fixes:**
46
+
47
+
- Fixed `take` and `extend` on empty slices
48
+
- Fixed issues with duplicate effects in rows [#511](https://github.com/koka-lang/koka/issue/511)
49
+
- Fixed issues with masking effects [#509](https://github.com/koka-lang/koka/issue/509)
50
+
- Fixed issues with finally [#360](https://github.com/koka-lang/koka/issue/360)
51
+
- Fixed name lookup with import renaming
52
+
- Fix optimized compilation from VS Code (which defaulted to lower optimization before)
53
+
- Improve Windows installation, check clang version and Windows build tools.
54
+
- Various other bug and documentation fixes, including many fixes to the JS backend, improvements to the installation process, and better type errors. Thanks @gsuuon [#562](https://github.com/koka-lang/koka/pull/562), @oconnor0 [#569](https://github.com/koka-lang/koka/pull/569), @kyepskee [#575](https://github.com/koka-lang/koka/pull/575)[#671](https://github.com/koka-lang/koka/pull/671), @arvidjonasson [#580](https://github.com/koka-lang/koka/pull/580), @Guest0x0 [#595](https://github.com/koka-lang/koka/pull/595), @osa1 [#604](https://github.com/koka-lang/koka/pull/604), @syaiful6 [#672](https://github.com/koka-lang/koka/pull/672), @timbertson [#677](https://github.com/koka-lang/koka/pull/677)[#692](https://github.com/koka-lang/koka/pull/692)[#712](https://github.com/koka-lang/koka/pull/712), @toh995 [#681](https://github.com/koka-lang/koka/pull/681), @ov7a [#740](https://github.com/koka-lang/koka/pull/740), @TimWhiting [#640](https://github.com/koka-lang/koka/pull/640)[#647](https://github.com/koka-lang/koka/pull/647)[#661](https://github.com/koka-lang/koka/pull/661)[#637](https://github.com/koka-lang/koka/pull/637)[#689](https://github.com/koka-lang/koka/pull/689)[#682](https://github.com/koka-lang/koka/pull/682)[#690](https://github.com/koka-lang/koka/pull/690)[#735](https://github.com/koka-lang/koka/pull/735)[#737](https://github.com/koka-lang/koka/pull/737)...
55
+
- Many other issues fixed.
56
+
57
+
**Extension Updates:**
58
+
59
+
- The extension now allows you to generate various functions based on the datatype [#622](https://github.com/koka-lang/koka/pull/622).
60
+
- You can more easily compile for different backends using the command `Koka: Set compilation target`.
61
+
- Added automatic release update notifications and compiler version management. Use the command `Koka: Download and install a specific version of the compiler` to download a specific version of the compiler.
62
+
- The VSCode extension now only activates in folders with `.kk`, or when a command is run.
0 commit comments