fp library

Stable functional primitives for Dust runtimes and generated code.

Import this library when app code wants Dust-owned Option, Result, or Unit types without taking a dependency on an external functional package. Dust keeps this contract stable during 0.1.x.

import 'package:dust_dart/fp.dart';

final nickname = Some<String?>('John');
final saved = Ok<Unit, String>(unit);

Classes

Err<T, E>
Failed operation result.
None<T>
Option state for an absent value.
Ok<T, E>
Successful operation result.
Option<T>
Optional value wrapper for Rust-style present-or-absent values.
Result<T, E>
Result of an operation that can either succeed with T or fail with E.
Some<T>
Option state for a present value.
Unit
Empty success value for operations that only signal completion.

Constants

unit → const Unit
Shared unit value.