-
Notifications
You must be signed in to change notification settings - Fork 6
Interface types, part 1
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
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:
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 are as follows:
🧿 Pipefish is distributed under the MIT license. Please steal my code and ideas.
- Getting started
- Language basics
- The type system and built-in functions
- Functional Pipefish
- Encapsulation
- Imperative Pipefish
-
Imports and libraries
- The files library
- The fmt library
- The html library
- The math library
- The math/big library
- The math/cmplx library
- The math/rand library
- The path library
- The path/filepath library
- The reflect library
- The regexp library
- The sql library
- The strings library
- The terminal library
- The time library
- The unicode library
- Advanced Pipefish
- Developing in Pipefish
- Deployment
- Appendices