Search packages, repositories and app categories

Package detailsv2.0.0

invertible

A Dart library for defining invertible functions and their compositions

AndroidiOSWebmacOSWindowsLinux
30-day downloads
14.8K
Likes
3
Pub points
140

Install package

flutter pub add invertible

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The invertible package is a Dart library designed to define and work with invertible functions—functions that can be reversed to retrieve the original input. It supports composing multiple invertible functions while preserving their invertibility, enabling safe and predictable transformations. Ideal for mathematical operations, data processing pipelines, and reversible computations, it ensures correctness through type safety and clear function contracts. The library is lightweight and compatible across all major platforms, making it suitable for cross-platform applications requiring bidirectional logic.

Use cases

  • Mathematical transformations
  • Data encoding/decoding
  • Reversible state management
  • Pipeline composition
  • Bidirectional data processing
  • Algorithmic reversibility

Key features

  • Supports invertible function composition
  • Type-safe inversion mechanisms
  • Cross-platform compatibility
  • Clear API for defining inverse functions
  • Lightweight and minimal dependencies
  • Robust error handling for non-invertible cases

Suitable for

  • Developers working with reversible algorithms
  • Mathematical or scientific computing
  • Applications needing data transformation with recovery
  • Engineers building modular transformation pipelines
  • Teams prioritizing correctness in functional programming

Considerations

  • Requires functions to be mathematically invertible
  • Not suitable for non-deterministic or stateful operations
  • Inversion must be explicitly defined
  • Limited to pure functions
  • Performance overhead for complex compositions

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

invertible - Define invertible functions and their compositions

Version Build Status Coverage Status License

A Dart library for defining invertible functions and their compositions

Usage

See example/invertible_example.dart

final InvertibleRealFunction celsiusToFahrenheit =
    InvertibleRealFunction.parse('* 9; / 5; + 32;');

final InvertibleRealFunction fahrenheitToCelsius = celsiusToFahrenheit.inverse();

final num fahrenheit = celsiusToFahrenheit(40);
// fahrenheit == 104

final num celsius = fahrenheitToCelsius(41);
// celsius == 5

Syntax

See documentation for more

License

MIT

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package