<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Type-Level-Programming on Dev &amp; Platform Engineering Hub</title><link>https://rhidayat.work/topics/type-level-programming/</link><description>Recent content in Type-Level-Programming on Dev &amp; Platform Engineering Hub</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2026 Rachmat Hidayat</copyright><lastBuildDate>Sun, 09 Aug 2026 13:30:00 +0000</lastBuildDate><atom:link href="https://rhidayat.work/topics/type-level-programming/index.xml" rel="self" type="application/rss+xml"/><item><title>TS Ep 3: Advanced TypeScript — Conditional Types, Infer Keyword, and Template Literal Metaprogramming</title><link>https://rhidayat.work/series/typescript/advanced/03-conditional-types-infer-and-template-literals/</link><pubDate>Sun, 09 Aug 2026 13:30:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/03-conditional-types-infer-and-template-literals/</guid><description>An advanced masterclass in TypeScript type-level metaprogramming. Master conditional types (T extends U ? X : Y), distributive behavior, infer keyword pattern matching for unwrapping types, template literal types (${T}_${U}), and deep recursive object transformations.</description></item><item><title>TS Ep 52: Variance (Covariance vs Contravariance)</title><link>https://rhidayat.work/series/typescript/advanced/12-variance-covariance-contravariance/</link><pubDate>Sun, 09 Aug 2026 13:30:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/12-variance-covariance-contravariance/</guid><description>Why is it safe to return a subclass instead of a superclass, but dangerous to accept a superclass parameter instead of a subclass? Welcome to Variance: the computer science underpinning of TypeScript&amp;rsquo;s assignability engine.</description></item><item><title>TS Ep 51: Type-Level State Machines</title><link>https://rhidayat.work/series/typescript/advanced/11-type-level-state-machines/</link><pubDate>Sun, 09 Aug 2026 13:25:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/11-type-level-state-machines/</guid><description>Use mapped types and generics to enforce finite state transitions in the compiler. A type-level state machine makes impossible states impossible to represent, eliminating entire classes of runtime bugs.</description></item><item><title>TS Ep 49: Recursive Types</title><link>https://rhidayat.work/series/typescript/advanced/09-recursive-types/</link><pubDate>Sun, 09 Aug 2026 13:15:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/09-recursive-types/</guid><description>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;
 How do you type a JSON object? A JSON object can contain arrays of objects, which can contain arrays of objects, infinitely down. You cannot hardcode this depth. You need a &lt;strong&gt;Recursive Type&lt;/strong&gt;.
&lt;/div&gt;</description></item><item><title>TS Ep 47: Template Literal Types</title><link>https://rhidayat.work/series/typescript/advanced/07-template-literal-types/</link><pubDate>Sun, 09 Aug 2026 13:05:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/07-template-literal-types/</guid><description>Template literal types allow you to use JavaScript-style template strings (&lt;code&gt;${...}&lt;/code&gt;) inside Type Space. Learn how to generate combinations of string literals automatically via Union Permutation, and parse delimited strings (like emails or URLs) using the &lt;code&gt;infer&lt;/code&gt; keyword.</description></item><item><title>TS Ep 46: Inferring Tuples and Arrays</title><link>https://rhidayat.work/series/typescript/advanced/06-infer-with-tuples-and-arrays/</link><pubDate>Sun, 09 Aug 2026 13:00:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/06-infer-with-tuples-and-arrays/</guid><description>Pattern matching with &lt;code&gt;infer&lt;/code&gt; isn&amp;rsquo;t just for Promises and Objects. You can deconstruct Tuples and Arrays element by element in Type Space, mirroring the exact syntax of JavaScript&amp;rsquo;s array destructuring and spread operators.</description></item><item><title>TS Ep 44: The `infer` Keyword (Pattern Matching)</title><link>https://rhidayat.work/series/typescript/advanced/04-the-infer-keyword/</link><pubDate>Sun, 09 Aug 2026 12:50:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/04-the-infer-keyword/</guid><description>If conditional types are the if-else statements of Type Space, the &lt;code&gt;infer&lt;/code&gt; keyword is the variable declaration (&lt;code&gt;let x = ...&lt;/code&gt;). Learn how to extract types dynamically via pattern matching, rebuild &lt;code&gt;ReturnType&lt;/code&gt;, and parse Template Literal Strings at compile time.</description></item><item><title>TS Ep 43: Preventing Distribution (Tuples)</title><link>https://rhidayat.work/series/typescript/advanced/03-preventing-distribution/</link><pubDate>Sun, 09 Aug 2026 12:45:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/03-preventing-distribution/</guid><description>Sometimes, you want a conditional type to evaluate an entire Union as a single monolithic entity, rather than mapping over its individual members. Learn how wrapping generic parameters in brackets &lt;code&gt;[T]&lt;/code&gt; prevents distribution, and how to use this mechanic to build complex &lt;code&gt;IsUnion&lt;/code&gt; checks.</description></item><item><title>TS Ep 42: Distributive Conditional Types</title><link>https://rhidayat.work/series/typescript/advanced/02-distributive-conditional-types/</link><pubDate>Sun, 09 Aug 2026 12:40:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/02-distributive-conditional-types/</guid><description>When you pass a Union type into a conditional type, TypeScript doesn&amp;rsquo;t evaluate the union as a whole. It evaluates every single member of the union separately, and combines the results. Learn how this powerful (and sometimes confusing) mechanism powers TypeScript&amp;rsquo;s standard library.</description></item><item><title>TS Ep 41: Conditional Types (The Basics)</title><link>https://rhidayat.work/series/typescript/advanced/01-conditional-types-basics/</link><pubDate>Sun, 09 Aug 2026 12:35:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/advanced/01-conditional-types-basics/</guid><description>Conditional types are the if-else statements of Type Space. Learn how to use the &amp;rsquo;extends ? :&amp;rsquo; syntax to compute dynamic types based on assignability logic, replace complex function overloads, and construct nested else-if type chains.</description></item><item><title>TS Ep 40: Key Remapping with `as`</title><link>https://rhidayat.work/series/typescript/intermediate/16-key-remapping-with-as/</link><pubDate>Sun, 09 Aug 2026 12:30:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/intermediate/16-key-remapping-with-as/</guid><description>Take your Mapped Types to the absolute limit. Learn how to compute entirely new string names for keys on the fly using Template Literal Types, and discover how to completely filter out properties by returning &lt;code&gt;never&lt;/code&gt; during key mapping.</description></item><item><title>TS Ep 38: Mapped Types (Basics)</title><link>https://rhidayat.work/series/typescript/intermediate/14-mapped-types-basics/</link><pubDate>Sun, 09 Aug 2026 12:20:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/intermediate/14-mapped-types-basics/</guid><description>An in-depth guide to Mapped Types in TypeScript. Learn how to use the &lt;code&gt;[K in Union]&lt;/code&gt; syntax to iterate over literal unions, transform existing object properties using &lt;code&gt;keyof&lt;/code&gt; and Indexed Access, and build strict state validation maps that perfectly mirror domain models.</description></item><item><title>Mastering TypeScript: From Fundamentals to Type-Level Programming &amp; Functional Effect-TS</title><link>https://rhidayat.work/series/typescript/</link><pubDate>Sun, 09 Aug 2026 12:00:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/</guid><description>The ultimate TypeScript masterclass roadmap. Master primitive types, type narrowing, generics, mapped types, conditional types, infer keyword, template literal types, type-level state machines, and functional Effect-TS architecture.</description></item><item><title>TS Ep 27: The `keyof` Type Operator</title><link>https://rhidayat.work/series/typescript/intermediate/03-keyof-operator/</link><pubDate>Sun, 09 Aug 2026 11:25:00 +0000</pubDate><guid>https://rhidayat.work/series/typescript/intermediate/03-keyof-operator/</guid><description>An exhaustive guide to the &lt;code&gt;keyof&lt;/code&gt; operator in TypeScript. Learn how &lt;code&gt;keyof&lt;/code&gt; extracts property key unions from object interfaces, array/tuple types, index signatures, and how to combine &lt;code&gt;keyof&lt;/code&gt; with Generics to build type-safe property accessors.</description></item></channel></rss>