Fields API Reference

website·Indexed 30 days ago

https://jap-company.github.io/fields/

API documentation for Fields, featuring tools for schema syntax, rule operations, and policy management. Includes integration support for ZIO and Cats, with specific components such as ZioBlocksSchemaSyntax, PolicyK, RuleOps, and FieldsInteropZIO.

Tokens
103.4K
Snippets
801
Records
1K
Agent score
72%

What's inside Fields

  1. Overview of fields.lens.syntax package members

    The fields.lens.syntax package provides a set of traits and classes that define the DSL for lens operations. Key components include:

    • Core DSLs: GenericDsl, CoreDsl, and FieldsDsl provide the base syntax for lens interactions.
    • Error Handling DSLs: FailFastDsl and AccumulateDsl (along with their base classes BaseFailFast and BaseAccumulate) manage how errors are processed during lens operations.
    • Collection-Specific Syntax:
      • IterableSyntax and IterableDsl for working with iterable collections, including IterableFieldOps.
      • MapSyntax and MapDsl for working with Map collections, including MapFieldOps.
      • OptionSyntax and OptionDsl for handling optional fields.
    • Policy Syntax: LensPolicySyntax for configuring lens policies via LensPolicyCompanionOps.
    • Utility: The all trait/object provides a combined entry point for the syntax extensions.
  2. Overview of CoreDsl trait

    The CoreDsl[F[_], V[_], E] trait in fields.lens.syntax serves as a central DSL for lens operations. It aggregates multiple specialized DSL traits, including GenericDsl, BooleanDsl, OrderingDsl, OptionDsl, StringDsl, MapDsl, IterableDsl, PolicySubDsl, LensPolicyDsl, and CommonSyntax. It is primarily used by classes like FieldsDsl, AccumulateDsl, and FailFastDsl to provide a unified syntax for field manipulation and validation.
  3. Overview of FailFastDsl

    FailFastDsl is an abstract class in the fields.lens namespace used for accumulating fail-fast validation logic. It extends FieldsDsl[F, FailFast, E], where F is the effect type and E is the error type. It integrates multiple syntax traits including CoreDsl, FieldSyntax, RuleSyntax, and FailFieldSyntax to provide a comprehensive set of tools for field-level operations and validation policies.
  4. Overview of BaseFailFast DSL

    fields.value.FieldsDsl.BaseFailFast is an abstract class that extends FieldsDsl. It provides a specialized DSL for fail-fast validation, allowing developers to define rules and policies that stop execution upon the first failure. It incorporates multiple syntax traits including FieldSyntax, PolicySyntax, RuleSyntax, and various specialized DSLs for Option, Map, String, and Boolean types.
  5. Overview of the Fields Scala validation library

    Fields is a Scala validation library designed with the following characteristics:

    • Final Tagless: Supports any Effect, Validated, or Error types.
    • Informative: Provides error paths to pinpoint where validation failed.
    • Expressive: Offers a rich and extendable validation syntax.
    • Lightweight: The core module has no external dependencies.
    • Rule-based: Handles complex validations using the Rule type.
    • Short-circuiting: Prevents the execution of undesired validation side-effects.
  6. Overview of the fields library package structure

    The fields library is organized into several specialized packages for different functionalities:

    • fields.circe: Circe integration
    • fields.error: Error handling
    • fields.fail: Failure mechanisms
    • fields.lens: Lens-based field access
    • fields.syntax: Syntax extensions
    • fields.typeclass: Typeclass definitions
    • fields.value: Value-level operations
  7. Overview of AccumulateDsl

    AccumulateDsl[F[_], E] is an abstract class in the fields.lens namespace used for accumulating field-level operations. It extends FieldsDsl and provides a comprehensive set of syntax traits (such as CoreDsl, RuleSyntax, and FailFieldSyntax) to define rules and policies that can be applied to fields via selectors.
  8. Overview of fields.lens.syntax.all trait

    The all trait in the fields.lens.syntax package is a comprehensive syntax aggregator. It extends multiple syntax traits—including GenericSyntax, BooleanSyntax, OrderingSyntax, OptionSyntax, StringSyntax, MapSyntax, IterableSyntax, PolicySubSyntax, LensPolicySyntax, and CommonSyntax—to provide a unified set of extension methods for lens operations.
  9. Overview of FieldsDsl

    fields.value.FieldsDsl is the base DSL class used to create targeted field operations. It extends AllDsl and incorporates multiple syntax traits including FieldSyntax, PolicySyntax, RuleSyntax, and ValidatedSyntax. It is parameterized by an effect type F, a validated type V, and an error type E.
  10. Overview of BaseFailFast DSL

    The BaseFailFast class is an abstract base for the FailFast Domain Specific Language (DSL) within the fields.lens.FieldsDsl namespace. It extends FieldsDsl and provides a set of tools for implementing fail-fast validation logic. It integrates multiple syntax traits including FailFieldSyntax, RuleSyntax, ValidatedSyntax, and various specialized DSLs for types like Map, String, Option, and Boolean.
    abstract class BaseFailFast[F[_], E] extends FieldsDsl[F, FailFast, E]
  11. Overview of FieldLens trait

    The fields.lens.FieldLens[P, +V] is a sealed trait used to define a lens for a field of type V within a parent structure of type P. It manages both the path to the field and the logic to extract its value. It has two primary known subtypes: Optional and Strict.