Jindřich Ivánekjindraivanek.hashnode.dev·Feb 8, 2024F# tips weekly #5: Discriminated Union TypesThis week, we'll look at some interesting details about Discriminated Union types. Tuple vs. Multiple Fields There is a subtle difference between these two cases of Discriminated Union (DU): type DU = | A of int * string | B of (int * string...Discuss·2 likes·393 readsF# tips weekly#fsharp
Jindřich Ivánekjindraivanek.hashnode.dev·Jan 11, 2024F# tips weekly #1: Single case DUSingle-case discriminated unions are a great way to avoid primitive obsession. 💡 Primitive obsession is an anti-pattern where primitive types are used too much in places where a custom type would be a better fit. By using custom types or wrapper ty...Discuss·3 likes·904 readsF# tips weekly#fsharp
Abhishek Sblog.abhishekvash.xyz·Sep 15, 2023TypeScript's Discriminated Unions and How I Began to Worry LessIf you’ve used Typescript in any real capacity, you’ve probably run into unions. Either defined in third-party libraries or your own definitions. You can define a union with almost any combination or number of types. They’re pretty simple and general...Discuss·1 like·27 readsTypeScript
Wagner Mwagnerm.hashnode.dev·Aug 22, 2023The Magic of Discriminated Union Types in TypeScriptThis is a handy Typescript trick! In simple terms, I like to describe this feature as conditional types. This feature allows you to do things like the below ApiResponse type, let the code talk for himself // You can assert the property will have a sp...Discuss·43 readsTypeScript