101
3
102
11
103
5
104
8
105
7
106
12

A discriminated union is a data structure that can hold one of several distinct types of data. This type-safety allows developers to build complex data structures, like API responses or state machine events, and ensures all possible cases are handled, preventing runtime errors.

This is a proposal that might come in C# 16

If you prefer this as a video explanation then Nick Chapsas made one: https://www.youtube.com/watch?v=tD46WVJ2h9I

107
4
108
2
109
3
C# 14 with Dustin Campbell (www.spreaker.com)
110
4
111
4
112
2
113
0
114
1
115
5
116
5
117
1
118
7
119
6
Deep C# - Bit Manipulation (www.i-programmer.info)
120
5
121
5
122
5
123
3
124
6
125
4
view more: ‹ prev next ›

C Sharp

1806 readers
2 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 3 years ago
MODERATORS