awesome-repositories.com
Blog
MCP
awesome-repositories.com

Descubre los mejores repositorios open-source con nuestra búsqueda potenciada por IA.

ExplorarBúsquedas curadasAlternativas open-sourceSoftware autohospedableBlogMapa del sitio
ProyectoAcerca deCómo clasificamosPrensaServidor MCP
Aviso legalPrivacidadTérminos
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
mcintyre321 avatar

mcintyre321/OneOf

0
View on GitHub↗
4,048 estrellas·164 forks·C#·MIT·4 vistas

OneOf

OneOf es una biblioteca de uniones discriminadas y generador de código fuente para C# que proporciona tipos suma funcionales. Sirve como una herramienta de polimorfismo fuertemente tipado, permitiendo a los desarrolladores definir parámetros de métodos y valores de retorno que pueden ser exactamente uno de varios tipos específicos.

El proyecto implementa patrones de programación funcional para reemplazar clases base genéricas con uniones seguras de tipos. Utiliza un generador de código fuente para producir automáticamente el código repetitivo necesario para gestionar estas jerarquías de tipos de unión durante la compilación.

La biblioteca proporciona mecanismos para coincidencia de patrones y extracción de valores de unión, con cumplimiento de exhaustividad en tiempo de compilación para asegurar que cada caso de tipo posible sea manejado en expresiones switch. Admite definiciones de tipos de unión reutilizables y diseño de API polimórfico a través de firmas de retorno de múltiples tipos y soporte de parámetros.

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.

Historial de estrellas

Gráfico del historial de estrellas de mcintyre321/oneofGráfico del historial de estrellas de mcintyre321/oneof

Búsqueda con IA

Explora más repositorios increíbles

Describe lo que necesitas en lenguaje sencillo: la IA clasifica miles de proyectos open-source curados por relevancia.

Start searching with AI

Alternativas open-source a OneOf

Proyectos open-source similares, clasificados según cuántas características comparten con OneOf.
  • microsoft/typescript-handbookAvatar de microsoft

    microsoft/TypeScript-Handbook

    4,855Ver en 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
    Ver en GitHub↗4,855
  • gibbok/typescript-bookAvatar de gibbok

    gibbok/typescript-book

    10,317Ver en GitHub↗

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

    JavaScriptbookfreejavascript
    Ver en GitHub↗10,317
  • error-or/error-orAvatar de error-or

    error-or/error-or

    2,058Ver en 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#
    Ver en GitHub↗2,058
  • microsoft/typespecAvatar de microsoft

    microsoft/typespec

    5,781Ver en 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
    Ver en GitHub↗5,781
Ver las 30 alternativas a OneOf→

Preguntas frecuentes

¿Qué hace mcintyre321/oneof?

OneOf es una biblioteca de uniones discriminadas y generador de código fuente para C# que proporciona tipos suma funcionales. Sirve como una herramienta de polimorfismo fuertemente tipado, permitiendo a los desarrolladores definir parámetros de métodos y valores de retorno que pueden ser exactamente uno de varios tipos específicos.

¿Cuáles son las características principales de mcintyre321/oneof?

Las características principales de mcintyre321/oneof son: Discriminated Unions, C# Source Code Generators, Exhaustiveness Analysis, Union State Matching, Exhaustive Pattern Matches, Container Value Matching, Type-Safe Discriminated Unions, Union Types.

¿Qué alternativas de código abierto existen para mcintyre321/oneof?

Las alternativas de código abierto para mcintyre321/oneof incluyen: 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…