News for hackers. Stuff that matters.
Re:Official proposal for Type Unions in C# by conor- on Thursday August 08, 2024 @09:24AM (#41191224)
This[0] lib implements F#-style discriminated unions. The way I've used it is to make my outer layers return "Result" types that wrap the DTO, error, etc. under one umbrella. It allows for pattern matching your results which makes error handling easier and also allows your models to evolve over time without changing your function signatures at the edge.

[0] https://github.com/mcintyre321/OneOf

There are no comments on this comment yet.