From 5e2cc0d1ef68f2ecd538c49c05cd8812b2f26bd3 Mon Sep 17 00:00:00 2001 From: Magnus Madsen Date: Sun, 30 Nov 2025 11:01:09 +0100 Subject: [PATCH] refactor: tweak section titles --- src/functions.md | 2 +- src/getting-started.md | 11 +++++------ src/introduction.md | 2 +- src/primitive-types.md | 4 ++-- src/records.md | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/functions.md b/src/functions.md index 40e1bbb0..e5f47b23 100644 --- a/src/functions.md +++ b/src/functions.md @@ -25,7 +25,7 @@ If a function argument is not used it must be prefixed with an underscore to explicitly mark it as unused. -## First-Class and Higher-Order Functions +## Higher-Order Functions A _higher-order function_ is a function that takes a parameter which is itself a function. diff --git a/src/getting-started.md b/src/getting-started.md index 7744d333..2f6c17d7 100644 --- a/src/getting-started.md +++ b/src/getting-started.md @@ -24,7 +24,7 @@ Once you have Java 21+ installed there are two ways to proceed: - You can use the [Flix VSCode extension](https://marketplace.visualstudio.com/items?itemName=flix.flix) (__highly recommended__) or - You can run the Flix compiler from the command line. -## Using Flix from Visual Studio Code (VSCode) +## Using Flix from VSCode Flix comes with a fully-featured VSCode plugin. Follow these steps to get started: @@ -52,7 +52,7 @@ get started: nvim --version ``` -### Neovim Flix plugin +### Neovim Plugin There is a Lua [plugin](https://github.com/flix/nvim) which provides an LSP configuration for the native neovim lsp, and several functions to interact with the flix cli. It's repo has detailed installation and configuration instructions. It can be installed with a plugin manager of choice or cloned locally into your neovim runtime path. @@ -117,7 +117,7 @@ The snippet above provides the following keybindings. ![Visual Studio Code1](images/neovim.png) -### Manual Neovim Configuration +### Manual Configuration If you would rather setup the LSP server yourself the code from the plugin is as follows. @@ -187,7 +187,7 @@ vim.api.nvim_create_autocmd("FileType", { Flix can be used from [Emacs](https://www.gnu.org/software/emacs/) as well by installing the [flix-mode](https://codeberg.org/mdiin/flix-mode) package. Follow the instructions there to get started writing Flix code in Emacs. -## Using Flix from the Command Line +## Using Flix from the CLI Flix can also be used from the command line. Follow these steps: @@ -196,8 +196,7 @@ Flix can also be used from the command line. Follow these steps: > 3. Enter the created directory (e.g. `cd my-flix-project`) and run `java -jar flix.jar init` to create an empty Flix project. > 4. Run `java -jar flix.jar run` to compile and run the project. - -## Using nix +## Installing Flix with Nix Flix can also be installed using the [nix package manager](https://nixos.org/). To install for the currently running shell run: diff --git a/src/introduction.md b/src/introduction.md index b7fe7f01..06af5ad0 100644 --- a/src/introduction.md +++ b/src/introduction.md @@ -29,7 +29,7 @@ always a 1:1 correspondence between the Flix language and what is reported in the editor. The advantages are many: (a) diagnostics are always exact, (b) code navigation "just works", and (c) refactorings are always correct. -## Look 'n' Feel +## Look and Feel Here are a few programs to illustrate the look and feel of Flix: diff --git a/src/primitive-types.md b/src/primitive-types.md index f8ea4b30..e7b65658 100644 --- a/src/primitive-types.md +++ b/src/primitive-types.md @@ -1,4 +1,4 @@ -# Primitive Types +# Primitives Flix supports the primitive types: @@ -21,7 +21,7 @@ Flix supports the primitive types: written without suffix, i.e. `123.0f64` can simply be written as `123.0` and `123i32` can be written as `123`. -## Built-in Literals +## Literals Flix has built-in syntactic sugar for lists, sets, maps and regex. diff --git a/src/records.md b/src/records.md index dfbd36fa..88edce76 100644 --- a/src/records.md +++ b/src/records.md @@ -82,7 +82,7 @@ let p2 = { -y | p1 }; Here the record `p2` has the same labels as `p1` except that the `y` label has been removed. -## Row Polymorphism: Open and Closed Records +## Row Polymorphism A function may specify that it requires a record with two labels: @@ -104,7 +104,7 @@ def g(r: {x = Int32, y = Int32 | s}): Int32 = r#x + r#y We can call this function with *any* record as long as it has `x` and `y` labels which are of type `Int32`. We say that the record type of `r` is *open*. -## Named Parameters with Records +## Named Parameters When a function has multiple parameters that share the same type, it is easy to get confused about the right argument order. For example, what does