arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Json

Description

Shared Aeson helpers for triple-state patch decoders. An omitted field leaves the value unchanged. An explicit null clears the override.

Synopsis

Documentation

Source #patchOptions :: Options

Generic options that omit Nothing fields. A cleared override is absent from the JSON.

Source #explicitOptionalField :: FromJSON a => Object -> Text -> Parser (Maybe (Maybe a))

Decode an override field with three states: absent (Nothing, leave unchanged), present and null (Just Nothing, clear), or present with a value (Just (Just v)).