← Graph

Difference between Literal and dry-types

question 3 connections

Audience question comparing Literal to dry-types. Joel Drapper's answer: Literal uses Ruby's existing `===` interface, so any Ruby object (including the class `String`) already is a type — no extra wrapper needed. dry-types defines bespoke type objects that also carry coercion rules and default values; Drapper thinks coercion and defaults belong on the *property*, not the type. A Literal type has exactly two responsibilities: describe membership (via ===) and optionally check subtype relationships.

answer_summary
Literal rides Ruby's === so any object is already a type; dry-types bundles coercion and defaults into the type, which Drapper considers the wrong layer.
question Difference between Literal and dry-types
about
Literal tool
Compares Literal's design.
question Difference between Literal and dry-types
about
dry-types tool
Directly asks about dry-types.
question Difference between Literal and dry-types
asked_at
First audience Q&A question.

Provenance