패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.10.1

dartz

Dart에서의 함수형 프로그래밍. 효율적인 불변 데이터 구조, 모나드, 렌즈 및 기타 FP 도구를 사용하여 Dart 코드를 정제하세요.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
58.3만
좋아요
1.6천
Pub 점수
130

패키지 설치

flutter pub add dartz

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Dartz는 Dart에 함수형 프로그래밍 개념을 도입하여 개발자가 더 깔끔하고 예측 가능한 코드를 작성할 수 있도록 해주는 Dart 라이브러리입니다. 불변 데이터 구조, Either와 Option과 같은 모나드, 그리고 안전한 데이터 조작을 위한 렌즈와 같은 도구를 제공합니다. 순수성을 장려하고 부작용을 피함으로써 Dartz는 타입 안전하게 오류와 선택적 값을 관리하는 데 도움을 줍니다. 명확한 에러 처리와 상태 관리를 갖춘 강력하고 유지보수가 쉬운 애플리케이션 개발에 이상적입니다.

사용 사례

  • Either를 사용한 오류 처리
  • Option을 사용하여 선택적 값을 관리하기
  • 순수 함수 만들기
  • 조합 가능한 비즈니스 로직 만들기
  • 기능 상태 관리 구현
  • 테스트 가능하고 유지보수 가능한 코드 작성

주요 기능

  • 불변 데이터 구조
  • 오류 처리를 위한 Either 모나드
  • 널 가능 값에 대한 옵션 유형
  • 기능적 업데이트를 위한 렌즈
  • 타입 안전한 조합
  • 경량이고 성능이 뛰어남

적합한 대상

  • 다트에서 함수형 프로그래밍을 찾는 개발자
  • 순수하고 테스트 가능한 코드를 추구하는 팀
  • 강력한 오류 처리가 필요한 응용 프로그램
  • 클린 아키텍처에 중점을 둔 프로젝트
  • 프론트엔드 및 백엔드 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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트