パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.10.1

dartz

Dartにおける関数型プログラミング。効率的な不変データ構造、モナド、レンズ、その他のFPツールを使用してDartコードを純粋化します。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
58.3万
いいね数
1560
Pub ポイント
130

パッケージをインストール

flutter pub add dartz

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Dartz は、関数型プログラミングのコンセプトを Dart に持ち込むための Dart ライブラリです。開発者がよりクリーンで予測可能なコードを書けるようにします。不変データ構造、Either や Option といったモナド、および安全なデータ操作に使用できるレンズなどのツールを提供します。純粋性を促進し、副作用を避けることで、Dartz は型安全な方法でエラーとオプショナル値を管理するのに役立ちます。明確なエラーハンドリングと状態管理を備えた堅牢で保守可能なアプリケーションの構築に最適です。

用途

  • Either を用いたエラー処理
  • Option を使ってオプショナルな値を管理する
  • 純関数の構築
  • 合成可能なビジネスロジックの作成
  • 機能的状態管理の実装
  • テスト可能で保守可能なコードを書く

主な機能

  • 不変データ構造
  • エラー処理のための Either モナド
  • null 値用のオプション型
  • 関数的更新用のレンズ
  • 型安全なコンポジション
  • 軽量でパフォーマンスに優れる

適している対象

  • Dartでの関数型プログラミングを求める開発者
  • 純粋でテスト可能なコードを目指すチーム
  • 堅牢なエラー処理を必要とするアプリケーション
  • クリーンアーキテクチャに焦点を当てたプロジェクト
  • フロントエンドおよびバックエンドのDartアプリケーション

注意事項

  • 関数型プログラミングの概念を理解している必要がある
  • 初心者にとって学習曲線が上がる可能性があります
  • シンプルなスクリプトや迅速なプロトタイプには適していません
  • より大きな構造化アプリケーションで最も効果的に使用される
  • 機能外コードとの統合には、調整が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

dartz

License Pub.dev Github Stars

Functional programming in Dart

  • Type class hierarchy in the spirit of cats, scalaz and the standard Haskell libraries
  • Immutable, persistent collections, including IVector, IList, IMap, IHashMap, ISet and AVLTree
  • Option, Either, State, Tuple, Free, Lens and other tools for programming in a functional style
  • Evaluation, a Reader+Writer+State+Either+Future swiss army knife monad
  • Type class instances (Monoids, Traversable Functors, Monads and so on) for included types, as well as for several standard Dart types
  • Conveyor, an implementation of pure functional streaming
  • Examples, showcasing core concepts
New to functional programming?

A good place to start learning is the excellent Functional Programming in Scala by Paul Chiusano and Rúnar Bjarnason. I can not recommend this book highly enough.
You can also take a look at Category Theory for Programmers by Bartosz Milewski.

Status
  • Starting with version 0.10.0, Dart 2.12+ is required
  • 0.9.x supports Dart 1 and older Dart 2 versions
  • Basic type class structure and collection classes are relatively stable, but might see restructuring in future releases
  • Optimized for dart2js/node/v8, with performance on the dart vm being of distant secondary concern
  • Most things are stack safe and reasonably efficient, but there are a couple of exceptions and plenty of room for further optimizations
  • The streaming/conveyor stuff is highly experimental
  • The lens implementation is experimental and very bare bones
License/Disclaimer

See LICENSE

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト