solnic / drops

🛠️ Tools for working with data effectively - data contracts using types, schemas, domain validation rules, type-safe casting, and more.
Other
251 stars 4 forks source link

Simplify and unify result tuples #38

Closed solnic closed 8 months ago

solnic commented 8 months ago

This moves the predicate input value to the meta portion of the result tuple. Previously it caused issues as it was hard to differentiate path from input value.

In general, result tuples shouldn't use values as left-side of a tuple. These positions should be reserved for defining types of information that a tuple carry. ie {:error, {:map, meta}} uses :map to indicate it's a map result.