Plushie.Type.Composite.Map (Plushie v0.7.0)

Copy Markdown View Source

Composite type for typed maps.

Two forms are supported:

Dictionary form with uniform key/value types:

field :scores, {:map, {:string, :integer}}

Record form with specific named fields:

field :dimensions, {:map, [width: :float, height: :float]}

The record form accepts both maps and keyword lists as input. Field lookup uses Map.fetch/2 to correctly preserve false and nil values.