Skip to content

Interface types, part 1

tim-hardcastle edited this page Dec 2, 2025 · 5 revisions

What is an interface?

An interface type defines an abstract type by saying that it is the union of all the concrete types with a given function or collection of functions defined on them.

For example, there are a number of built-in types for your convenience, such as

image

This includes every type with an operation which adds a value of that type to another value of that type and returns a values of the same type. So it contains at least int, float, list, string and set, and then whatever other types you decide to define addition on.

You can also define your own interface types as you please:

image

Besides just defining abstract types they play another role, but we will discuss this on a later page, after we have introduced modules.

The built-in interfaces

The built-in interfaces are as follows:

image

🧿 Pipefish

Clone this wiki locally