Table of Contents

1 Introduction

1.1 Command Line Interpreter

1.2 Hello World

1.3 Main Wafl Concepts

1.4 Introduction to the Types

2 Program Structure

2.1 Program Is an Expression

2.2 Comments

2.3 Tuples

2.4 Local Definitions

2.5 Function Definition

2.6 Named Expression Definition

2.7 No Variables

2.8 The Order of the Definitions

2.9 Conditional Expression if

2.10 Conditional Expression switch

2.11 Recursion

2.12 Libraries

3 Programming With Functions

3.1 Strict Type Checking

3.2 Automatic Type Inference

3.3 Polymorphism

3.4 Higher Order Functions

3.5 Partial Application

3.6 Lambda Functions

3.7 Lambda Closures

3.8 Operators as Functions

3.9 Dot Operator

3.10 Explicit Computation State

3.11 Cached Functions

4 Primitive Types

4.1 Literals

4.2 Operators

4.3 Conversion Functions

4.4 Integer Functions

4.5 Float Functions

4.6 String Functions

4.7 DateTime Functions

5 List Type

5.1 List Literals

5.2 Basic List Functions

5.3 Basic List Processing

5.4 Advanced List Processing

5.5 More List Functions

5.6 Functions map and mapIdx

5.7 Functions zip and cross

5.8 Functions foldr, foldl and fold

5.9 Selection Functions

5.10 Functions for Finding Elements

5.11 Functions forall and exists

5.12 Functions count and countRep

5.13 Functions sort and sortBy

5.14 Functions in and contains

5.15 Lazy Lists

6 Structured Types

6.1 Array Type

6.2 Map Type

6.3 Tuple Type

6.4 Record Type

7 Databases

7.1 Database Connection

7.2 Queries

7.3 Transactions

8 Elements of Wafl Library

8.1 Program Control

8.2 File Reading

8.3 File Writing

8.4 File Operations

8.5 Directory Operations

8.6 File Operations Error Handling

8.7 Regex Functions

8.8 Command Line

8.9 Web and HTTP Functions

8.10 Wafl to JSON

8.11 Wafl Program Evaluation

9 Parallelization

9.1 Wafl and Parallelization

9.2 Parallel Functions

10 Wafl Library Reference

10.1 Core Library

10.2 Binary Libraries

10.3 Wafl Libraries

11 Command Line Reference

11.1 Command Line Options

11.2 Configuration Files

11.3 ANSI Control Codes

12 Advanced

12.1 JIT

12.2 Wafl Binary Libraries

13 Issues

13.1 Linux Issues

14 More Content…

14.1 Soon…

 

 

Last update: 11.07.2026.

Wafl

Wafl

Tutorial / 13 - Issues

Open printable version

13 Issues

13.1 Linux Issues

UTF-8 Comparison and Sort Problems

Wafl attempts to use the en_US.UTF-8 locale. If it is not available, the closest available one will be used. However, that may lead to unexpected results.

To check the available locales, run:

locale -a

To check which locales are used by Wafl, run:

wl -code "strLocale()"
wl -code "utf8Locale()"

To install the en_US.UTF-8 locale, use the following commands (or equivalent for your Linux distribution):

sudo apt update
sudo apt install locales
sudo locale-gen en_US.UTF-8

SDL Misconfiguration

On some Linux distributions, when using the SDL library in Wafl, an error message like this may be displayed:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  25 (X_SendEvent)
  Resource id in failed request:  0x1400009
  Serial number of failed request:  9
  Current serial number in output stream:  11

The problem is with the incorrect configuration of SDL. It should be enough to install the libsdl3-dev package. Installing the package will set the correct configuration of the library. After that, the package can be removed, and the problems should not repeat.

sudo apt install libsdl3-dev
sudo apt remove libsdl3-dev

In many cases the installation of libsdl2-dev does the same.

Wafl Home            Downloads            Wafl Tutorial v.0.6.11 © 2021-2026 Saša Malkov            Open printable version