Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/fsharp/language-reference/discriminated-unions.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,18 @@ The following example demonstrates this:
```fsharp
type ShaderProgram = | ShaderProgram of id:int

let someMethodUsingShaderProgram shaderProgram =
let someFunctionUsingShaderProgram shaderProgram =
let (ShaderProgram id) = shaderProgram
// Use the unwrapped value
..
...
```

Pattern matching is also allowed directly in function parameters, so you can unwrap a single case there:

```fsharp
let someFunctionUsingShaderProgram (ShaderProgram id) =
// Use the unwrapped value
...
```

## Struct Discriminated Unions
Expand Down