# fs-fio/fio architecture

> Architecture diagram of the GitHub repository fs-fio/fio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fs-fio/fio
- Repository: https://github.com/fs-fio/fio

## Overview

FIO is a typed, purely functional effects library for F# with fibers and pluggable runtimes, plus HTTP, TCP socket, and WebSocket extensions. The principal workflow is to compose lazy effects with the DSL, then run them through FIOApp and a runtime; the app handles the settled outcome and shutdown. README documentation supports the core workflow and major capabilities, but no source excerpts were available, so internal wiring beyond those documented relationships is omitted.

Main entry points: [`src/FIO/App.fs`](https://github.com/fs-fio/fio/blob/main/src/FIO/App.fs) (FIOApp), [`src/FIO/DSL/Core.fs`](https://github.com/fs-fio/fio/blob/main/src/FIO/DSL/Core.fs) (Typed effects), [`src/FIO/DSL`](https://github.com/fs-fio/fio/tree/main/src/FIO/DSL) (DSL and operators), [`src/FIO/Runtime`](https://github.com/fs-fio/fio/tree/main/src/FIO/Runtime) (Runtime family)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_composition["Effect composition"]
  node_dsl["DSL and operators"]
  node_effects["Typed effects<br/>[Core.fs]"]
end

subgraph group_execution["Execution and concurrency"]
  node_app["FIOApp<br/>[App.fs]"]
  node_runtime["Runtime family"]
  node_fibers["Fibers"]
  node_channels["Typed channels"]
  node_structured["Parallel combinators"]
  node_refs["Atomic refs<br/>[Ref.fs]"]
  node_finalizers["Finalizers"]
end

subgraph group_io["Core I/O"]
  node_console["Console<br/>[Console.fs]"]
end

subgraph group_network["Network extensions"]
  node_http["HTTP server<br/>[Server.fs]"]
  node_sockets["TCP sockets<br/>[Socket.fs]"]
  node_socketserver["TCP server<br/>[ServerSocket.fs]"]
  node_socketcodec["Socket codecs<br/>[Codec.fs]"]
  node_websockets["WebSockets<br/>[WebSocket.fs]"]
  node_websocketserver["WebSocket server<br/>[WebSocketServer.fs]"]
end

node_developer(("Application developer"))
node_terminal(("Terminal"))
node_httpclient(("HTTP clients"))

node_developer -->|"composes"| node_dsl
node_dsl -->|"builds"| node_effects
node_developer -->|"starts"| node_app
node_app -->|"runs"| node_effects
node_app -->|"uses"| node_runtime
node_runtime -->|"interprets"| node_effects
node_terminal -->|"input"| node_console
node_console -->|"output"| node_terminal
node_httpclient -->|"requests"| node_http

click node_dsl "https://github.com/fs-fio/fio/tree/main/src/FIO/DSL"
click node_effects "https://github.com/fs-fio/fio/blob/main/src/FIO/DSL/Core.fs"
click node_app "https://github.com/fs-fio/fio/blob/main/src/FIO/App.fs"
click node_runtime "https://github.com/fs-fio/fio/tree/main/src/FIO/Runtime"
click node_fibers "https://github.com/fs-fio/fio/tree/main/src/FIO/DSL"
click node_channels "https://github.com/fs-fio/fio/tree/main/src/FIO/DSL"
click node_structured "https://github.com/fs-fio/fio/tree/main/src/FIO/DSL"
click node_refs "https://github.com/fs-fio/fio/blob/main/src/FIO/DSL/Ref.fs"
click node_finalizers "https://github.com/fs-fio/fio/tree/main/src/FIO/DSL"
click node_console "https://github.com/fs-fio/fio/blob/main/src/FIO/Console.fs"
click node_http "https://github.com/fs-fio/fio/blob/main/src/FIO.Http/Server.fs"
click node_sockets "https://github.com/fs-fio/fio/blob/main/src/FIO.Sockets/Socket.fs"
click node_socketserver "https://github.com/fs-fio/fio/blob/main/src/FIO.Sockets/ServerSocket.fs"
click node_socketcodec "https://github.com/fs-fio/fio/blob/main/src/FIO.Sockets/Codec.fs"
click node_websockets "https://github.com/fs-fio/fio/blob/main/src/FIO.WebSockets/WebSocket.fs"
click node_websocketserver "https://github.com/fs-fio/fio/blob/main/src/FIO.WebSockets/WebSocketServer.fs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dsl,node_effects,node_httpclient toneBlue
class node_app,node_runtime,node_fibers,node_channels,node_structured,node_refs,node_finalizers toneAmber
class node_console toneMint
class node_http,node_sockets,node_socketserver,node_socketcodec,node_websockets,node_websocketserver toneRose
class node_developer,node_terminal toneIndigo
```

## Components

### Effect composition

- [DSL and operators](https://github.com/fs-fio/fio/tree/main/src/FIO/DSL): `src/FIO/DSL`
- [Typed effects](https://github.com/fs-fio/fio/blob/main/src/FIO/DSL/Core.fs): `src/FIO/DSL/Core.fs`

### Execution and concurrency

- [FIOApp](https://github.com/fs-fio/fio/blob/main/src/FIO/App.fs): `src/FIO/App.fs`
- [Runtime family](https://github.com/fs-fio/fio/tree/main/src/FIO/Runtime): `src/FIO/Runtime`
- [Fibers](https://github.com/fs-fio/fio/tree/main/src/FIO/DSL): `src/FIO/DSL`
- [Typed channels](https://github.com/fs-fio/fio/tree/main/src/FIO/DSL): `src/FIO/DSL`
- [Parallel combinators](https://github.com/fs-fio/fio/tree/main/src/FIO/DSL): `src/FIO/DSL`
- [Atomic refs](https://github.com/fs-fio/fio/blob/main/src/FIO/DSL/Ref.fs): `src/FIO/DSL/Ref.fs`
- [Finalizers](https://github.com/fs-fio/fio/tree/main/src/FIO/DSL): `src/FIO/DSL`

### Core I/O

- [Console](https://github.com/fs-fio/fio/blob/main/src/FIO/Console.fs): `src/FIO/Console.fs`

### Network extensions

- [HTTP server](https://github.com/fs-fio/fio/blob/main/src/FIO.Http/Server.fs): `src/FIO.Http/Server.fs`
- [TCP sockets](https://github.com/fs-fio/fio/blob/main/src/FIO.Sockets/Socket.fs): `src/FIO.Sockets/Socket.fs`
- [TCP server](https://github.com/fs-fio/fio/blob/main/src/FIO.Sockets/ServerSocket.fs): `src/FIO.Sockets/ServerSocket.fs`
- [Socket codecs](https://github.com/fs-fio/fio/blob/main/src/FIO.Sockets/Codec.fs): `src/FIO.Sockets/Codec.fs`
- [WebSockets](https://github.com/fs-fio/fio/blob/main/src/FIO.WebSockets/WebSocket.fs): `src/FIO.WebSockets/WebSocket.fs`
- [WebSocket server](https://github.com/fs-fio/fio/blob/main/src/FIO.WebSockets/WebSocketServer.fs): `src/FIO.WebSockets/WebSocketServer.fs`

### Other components

- **Application developer**
- **Terminal**
- **HTTP clients**

## Connections

- Application developer → DSL and operators: composes
- DSL and operators → Typed effects: builds
- Application developer → FIOApp: starts
- FIOApp → Typed effects: runs
- FIOApp → Runtime family: uses
- Runtime family → Typed effects: interprets
- Terminal → Console: input
- Console → Terminal: output
- HTTP clients → HTTP server: requests
