awesome-repositories.com
المدونة
MCP
awesome-repositories.com

اكتشف أفضل مستودعات المصادر المفتوحة باستخدام بحث مدعوم بالذكاء الاصطناعي.

استكشفعمليات بحث منسقةبدائل مفتوحة المصدربرمجيات ذاتية الاستضافةالمدونةخريطة الموقع
المشروعحولكيفية ترتيب النتائجالصحافةخادم MCP
قانونيالخصوصيةالشروط
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
mcintyre321 avatar

mcintyre321/OneOf

0
View on GitHub↗
4,048 نجوم·164 تفرعات·C#·MIT·4 مشاهدات

OneOf

OneOf is a C# discriminated union library and source generator that provides functional sum types. It serves as a strongly typed polymorphism tool, allowing developers to define method parameters and return values that can be exactly one of several specific types.

The project implements functional programming patterns to replace generic base classes with type-safe unions. It utilizes a source generator to automatically produce the boilerplate code required to manage these union type hierarchies during compilation.

The library provides mechanisms for pattern matching and union value extraction, featuring compile-time exhaustiveness enforcement to ensure every possible type case is handled in switch expressions. It supports reusable union type definitions and polymorphic API design through multi-type return signatures and parameter support.

Features

  • Discriminated Unions - Provides a library for implementing tagged sum types (discriminated unions) in C# with safe runtime switching.
  • C# Source Code Generators - Utilizes C# source generators to automatically produce the class hierarchies and metadata required for union types.
  • Exhaustiveness Analysis - Analyzes switch expressions to ensure every member of a union is handled, triggering a compiler error for missing cases.
  • Union State Matching - Provides mechanisms to execute specific handler functions based on the active variant of a union type.
  • Exhaustive Pattern Matches - Enforces that all variants of a union are handled in pattern matches, providing warnings or errors for incomplete cases.
  • Container Value Matching - Allows the extraction of values from multi-type containers using structural matching and switch blocks.
  • Type-Safe Discriminated Unions - Implements discriminated unions in C# to ensure every possible type is handled at compile time during pattern matching.
  • Union Types - Provides a utility to generate C# union types that can represent any one of several specified member types.
  • Closed Class Hierarchies - Implements closed class hierarchies via source generation to restrict the possible types within a union.
  • Strongly Typed Polymorphism - Provides a mechanism for defining method parameters and return values that can be exactly one of several specific types.
  • Sum Type Wrappers - Wraps multiple potential types in a single object that preserves type safety while allowing polymorphic value retrieval.
  • Sum Type Return Values - Provides the capability to return a value that can be any one of several predefined specific types.
  • Sum Type Returns - Enables functions to return one of several distinct types, replacing generic base classes with strongly typed signatures.
  • Functional Programming Patterns - Brings F#-style algebraic data types and functional programming paradigms into the imperative C# environment.
  • Union Type Parameters - Allows methods to accept one of several different types as a parameter, reducing the need for multiple method overloads.
  • Polymorphic API Signatures - Enables method signatures that accept or return one of several specific types without relying on generic base classes.
  • Algorithms and Data Structures - Provides discriminated unions with compile-time exhaustive matching.

سجل النجوم

مخطط تاريخ النجوم لـ mcintyre321/oneofمخطط تاريخ النجوم لـ mcintyre321/oneof

بحث بالذكاء الاصطناعي

استكشف المزيد من المستودعات الرائعة

صف ما تحتاجه بلغة بسيطة — وسيقوم الذكاء الاصطناعي بترتيب آلاف المشاريع مفتوحة المصدر المنسقة حسب الصلة.

Start searching with AI

الأسئلة الشائعة

ما هي وظيفة mcintyre321/oneof؟

OneOf is a C# discriminated union library and source generator that provides functional sum types. It serves as a strongly typed polymorphism tool, allowing developers to define method parameters and return values that can be exactly one of several specific types.

ما هي الميزات الرئيسية لـ mcintyre321/oneof؟

الميزات الرئيسية لـ mcintyre321/oneof هي: Discriminated Unions, C# Source Code Generators, Exhaustiveness Analysis, Union State Matching, Exhaustive Pattern Matches, Container Value Matching, Type-Safe Discriminated Unions, Union Types.

ما هي البدائل مفتوحة المصدر لـ mcintyre321/oneof؟

تشمل البدائل مفتوحة المصدر لـ mcintyre321/oneof: microsoft/typescript-handbook — This project is a comprehensive guide and educational resource for the TypeScript language. It covers the fundamental… error-or/error-or — Error-or is a library that implements the result pattern to replace exception-based control flow with structured data.… gibbok/typescript-book — The Concise TypeScript Book: A Concise Guide to Effective Development in TypeScript. Free and Open Source. microsoft/typespec — TypeSpec is a language for defining cloud API shapes and generating OpenAPI, JSON Schema, and client/server code from… odin-lang/odin — Odin is a compiled, statically typed systems programming language designed for high-performance software development.… typescript-cheatsheets/react — This project is a collection of technical reference guides and cheatsheets for implementing static typing patterns…

بدائل مفتوحة المصدر لـ OneOf

مشاريع مفتوحة المصدر مشابهة، مرتبة حسب عدد الميزات المشتركة مع OneOf.
  • microsoft/typescript-handbookالصورة الرمزية لـ microsoft

    microsoft/TypeScript-Handbook

    4,855عرض على GitHub↗

    This project is a comprehensive guide and educational resource for the TypeScript language. It covers the fundamental principles of the language, including its structural type system, static type analysis, and the process of transpiling typed source files into JavaScript. The material details how to model complex data and reusable type logic using generics, conditional types, and mapped types. It also explains the use of declaration files to provide type safety for external JavaScript libraries and the integration of type checking into existing JavaScript projects via JSDoc annotations. The

    JavaScriptdocumentationlearntypescript
    عرض على GitHub↗4,855
  • gibbok/typescript-bookالصورة الرمزية لـ gibbok

    gibbok/typescript-book

    10,317عرض على GitHub↗

    The Concise TypeScript Book: A Concise Guide to Effective Development in TypeScript. Free and Open Source.

    JavaScriptbookfreejavascript
    عرض على GitHub↗10,317
  • error-or/error-orالصورة الرمزية لـ error-or

    error-or/error-or

    2,058عرض على GitHub↗

    Error-or is a library that implements the result pattern to replace exception-based control flow with structured data. It provides a discriminated union implementation that encapsulates either a successful value or an error state within a single type, ensuring that operation outcomes are treated as first-class values. The library enables functional error handling by providing a fluent interface for chaining sequential operations. This monadic pipeline composition allows developers to define dependent operations that automatically short-circuit and return an error if any individual step in the

    C#
    عرض على GitHub↗2,058
  • microsoft/typespecالصورة الرمزية لـ microsoft

    microsoft/typespec

    5,781عرض على GitHub↗

    TypeSpec is a language for defining cloud API shapes and generating OpenAPI, JSON Schema, and client/server code from a single source of truth. It functions as a protocol-agnostic API designer that models REST, gRPC, and other API protocols using a unified, extensible syntax, with a decorator-based metadata system for attaching metadata, validation rules, and lifecycle visibility to API models and operations. The compiler produces OpenAPI 3.0 specifications and other artifacts, and the tool supports declaring API versions and tracking changes to models, properties, and operations across releas

    Javajson-schemaopenapi3protobuf
    عرض على GitHub↗5,781
  • عرض جميع البدائل الـ 30 لـ OneOf→