types

Dry-rb gems for functional programming patterns

Dry-rb provides functional programming tools for Ruby. dry-validation creates complex validation schemas with type checking. dry-types defines strict types—coercion, constraints, sum types. I use dry-struct for immutable data structures with typed att

TypeScript types from Rails serializers

Keeping TypeScript types in sync with Rails API responses is critical but tedious. I generate TypeScript interfaces automatically from Rails serializers or JSON Schema using tools like quicktype or custom scripts. For manual definitions, I create a ty

Sized trait and ?Sized for dynamically-sized types

Most types in Rust are Sized (known size at compile time), which is an auto trait. Some types like str or [T] are !Sized (dynamically-sized types, DSTs). To work with DSTs, use &T or Box<T>. In generic code, T: Sized is the default bound. To