Wafl Home

Program Structure Tutorial

Type Checking

Programming language Wafl is strongly typed. The detailed and very strict type checking is required before the program evaluation. Each function application must comply with the function type. Because of strict type checking, there are no implicit type conversions allowed.

In the following example we can see a program with wrong type usage. Because there is no addition operator defined for operands of different types, an error is reported.

Source code:

// This code segment intentionaly contains errors.
1 + 2.0

Result:

*** Loading: src
The expression type is not suitable for the context: 
  --> 2.000000
-     Program: '1
Typechecking failed!
*** End loading: src

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.