---
title: "Discussion on \"F# tips weekly #1: Single case DU\" | Hashnode"
description: "Discussion on \"F# tips weekly #1: Single case DU\". Single-case discriminated unions are a great way to avoid primitive obsession.\n\n💡\nPrimitive 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..."
url: "https://hashnode.com/posts/f-tips-weekly-1-single-case-du/659f8fad522c240171ca61ca"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [F# tips weekly #1: Single case DU](https://jindraivanek.hashnode.dev/f-tips-weekly-1-single-case-du?utm_source=hashnode&utm_medium=feed)

Single-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...

Jan 11, 2024 · 2 min read · jindraivanek.hashnode.dev  
Updated Jan 31, 2024  
Read the article

-   [#fsharp](https://hashnode.com/tag/fsharp)
-   [#discriminated-union-types](https://hashnode.com/tag/discriminated-union-types)
-   [#dotnet](https://hashnode.com/tag/dotnet)
-   [#tips](https://hashnode.com/tag/tips)

## Written by

[Jindřich Ivánek](https://hashnode.com/@jindraivanek)

@jindraivanek · Prague, Czech Republic

  
[View profile](https://hashnode.com/@jindraivanek)

F# developer

Software developer focused mainly on F#, with a passion for functional programming, problem solving, efficient algorithms and programming languages. I have a strong computer science background, focused mainly in graph theory and graph algorithms; also was intrigued by data structures, complexity, and computability theory. Experienced with backend F# programming. I worked with mathematical optimization (mixed integer programming) and use of statistical methods as well. I contributed to several open source F# projects, mostly around developer tooling.

## Responses 1

Markdown supported · ⌘↵ to post

[Andrés G. Aragoneses](https://hashnode.com/@knocte)

[Jan 30, 2024](https://hashnode.com/posts/f-tips-weekly-1-single-case-du/659f8fad522c240171ca61ca/comment/65b8b762ff63c5486151735a)

> member this.Value = let (ItemId value) = this in value

You lost me here. What is the `in` keyword and where can I learn more?

[Jindřich Ivánek](https://hashnode.com/@jindraivanek)

[Jan 30, 2024](https://hashnode.com/posts/f-tips-weekly-1-single-case-du/659f8fad522c240171ca61ca/comment/65b8b762ff63c5486151735a#reply-65b8ce5468f8d70747101803)

[Andrés G. Aragoneses](https://hashnode.com/@knocte) Yes, comment eats newlines. I edited my comment to show the code properly.

[Andrés G. Aragoneses](https://hashnode.com/@knocte)

[Jan 30, 2024](https://hashnode.com/posts/f-tips-weekly-1-single-case-du/659f8fad522c240171ca61ca/comment/65b8b762ff63c5486151735a#reply-65b8cef4c1126ab971b18684)

[Jindřich Ivánek](https://hashnode.com/@jindraivanek) Ok that is more understandable. I think the `in` keyword maybe deserves an entire blog entry for itself, so if I were you, I would decouple this blog entry from this new potential one (if you're distilling complex topics, it's better to explain them with the most basic elements, not making use of other complex topics).

[Jindřich Ivánek](https://hashnode.com/@jindraivanek)

[Jan 31, 2024](https://hashnode.com/posts/f-tips-weekly-1-single-case-du/659f8fad522c240171ca61ca/comment/65b8b762ff63c5486151735a#reply-65ba4659795c8e4ca4f6214c)

[Andrés G. Aragoneses](https://hashnode.com/@knocte) I think it deserve note in the article. I added it. Thanks for the pointer.
