-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Ahmad Al-freihat edited this page Jan 1, 2026
·
2 revisions
A simple and lightweight implementation of a non-empty list in C#, inspired by Scala's List, that ensures a collection always has at least one item.
- Non-Empty Guarantee: Always contains at least one element
-
Head/Tail Access: Convenient
Head,Tail,Init,First, andLastproperties -
Functional Operations:
Map,FlatMap,Reduce,Fold,Zip,Partition, and more -
Pattern Matching:
Matchmethod and deconstruction support - Async Support: Full async extension methods for all operations
-
Immutable Variant:
ImmutableNonEmptyList<T>for thread-safe scenarios - JSON Serialization: Built-in System.Text.Json support
- EF Core Integration: Entity Framework Core support via separate package
-
Equality Support: Implements
IEquatable<T>with==and!=operators - Multi-targeting: Supports .NET 6.0 and .NET 8.0
- Getting Started - Installation and basic usage
- Core Concepts - Properties and fundamentals
- Creating NonEmptyList - Constructors and factory methods
- Functional Operations - Map, FlatMap, Reduce, Fold, Zip, Partition
- Pattern Matching - Match method and deconstruction
- Collection Operations - Concat, Prepend, Reverse, Sliding, Chunks
- Conversion Methods - ToArray, ToHashSet, ToDictionary
- Utility Methods - Random, MinBy, MaxBy, ForEachWithIndex
- Validation - Validate and TryValidate methods
- Error Handling - Exception behavior
- Thread Safety - Concurrency considerations
- Async Operations - MapAsync, FilterAsync, FoldAsync
- ImmutableNonEmptyList - Immutable variant for thread-safe scenarios
- JSON Serialization - System.Text.Json support
- EF Core Integration - Entity Framework Core support
- Equality and Comparison - Equality operators and comparers