Changelog
View SourceAll notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.2.1 - 2026-05-02
Changed
- Performance: scalar parser options are now extracted at parser
construction time rather than folded over the options map on every
parse call.
map/0short-circuits to a plainis_mapcheck. Median speedups (1M iter, OTP 28 / ARM macOS):binary/1,integer/1,float/1with options ~5x;map/0~6x;list/1,2over 100 elements ~2x;map/1,2schemas 1.2-1.4x;map_of/21.4x. Seetest/zz_bench.erl.
Fixed
- Doc type cross-references in README and CHANGELOG now use
module-qualified syntax (
zz:parser/1,zz:issues/0), eliminating ex_doc warnings on publish.
Tooling
- Added
mise format-checktask (parity with CI'srebar3 fmt --check). - Added
mise benchtask andtest/zz_bench.erlmicro-benchmark harness. - Added
CODE_OF_CONDUCT.md. - Split
integer_typed_testsintopos_integer_tests,non_neg_integer_tests,neg_integer_testsfor consistency with the one-file-per-function project convention.
0.2.0 - 2026-05-02
Added
zz:issues/1flattens nestederrors()into a flat list of issue maps withpathandcode.unknown_keysissues carrykeys;no_matchissues carrybranches(one nested issue list per union branch).- New exported types:
issue/0,issues/0,path/0. parser/1andoptional_parser/1types are now parameterized over the parsed value type, sozz:parse/2reports the precise output type (e.g.parse(zz:integer(), X) -> result(integer())).parser/0andoptional_parser/0remain asparser(term())/optional_parser(term())aliases for back-compat.zz:lazy/1defers parser construction so schemas can reference themselves (recursive shapes like trees and JSON-like values).zz:map_of/2validates a homogeneous map: every key parsed by the first parser, every value by the second. Key errors surface as{map_key, OriginalKey, InnerErrors}; value errors as{map_value, OriginalKey, InnerErrors}.zz:issues/1flattens key errors ascode => invalid_keyissues withkeyanderrorsfields.zz:char/0validates a single Unicode codepoint (integer in0..16#10FFFF).zz:char_list/0validates a[char()], the old-style Erlang string representation.zz:pid/0validates a process identifier.zz:reference/0validates a reference (e.g. frommake_ref/0).zz:iodata/0validatesiodata()(a binary oriolist()).zz:iolist/0validates aniolist()only (binary input rejected).zz:number/0validates an integer or float.zz:enum/1validates that input equals (=:=) one of a list of values; fails withnot_in_enum.zz:nullable/1acceptsundefinedalongside the wrapped parser's values. Sugar forunion([literal(undefined), Z]).zz:any/0accepts any input, output equals input. Useful as a placeholder.zz:bitstring/0,1validates a bitstring, with optionalmin/maxbit_size/1constraints.zz:function/0validates any function.zz:function/1validates a function with the given arity.zz:pos_integer/0,zz:non_neg_integer/0,zz:neg_integer/0validate the corresponding integer subtypes.zz:format_issues/1formatszz:issues/0as a human-readable binary, one issue per line.
Changed
zz:tuple/1now takes a tuple of parsers instead of a list, so the schema mirrors the shape it validates:zz:tuple({zz:integer(), zz:binary()})instead ofzz:tuple([...]).- Map errors are now tagged symmetrically:
{map_value, K, [errs]}for value-parser failures (was{map, K, [errs]}) and{map_missing, K}for required-key absences (was{map, K, missing_key}). Pattern matches on the old shapes need to update.
Removed
zz:list/1no longer accepts a list of parsers (the heterogeneous fixed-length form). Usezz:tuple/1for fixed-length heterogeneous data. Thelength_mismatcherror code is gone.
0.1.0 - 2026-05-02
Initial public release.
Added
- Parser combinators:
atom/0,binary/0,1,boolean/0,integer/0,1,float/0,1,list/0,1,2,literal/1,map/0,1,2,optional/1,tuple/0,1,union/1. parse/2entry point.- Map
unknown_keysmodes:strip,passthrough,strict. - Property-based tests via PropEr.
- Public exported types:
parser/0,optional_parser/0,result/1,errors/0,binary_options/0,integer_options/0,float_options/0,list_options/0,map_options/0,schema/0. - eqwalizer-clean:
elp eqwalize-allreports no errors.