BeatyBit.Bits 0.0.21

Requires NuGet 2.8 or higher.

dotnet add package BeatyBit.Bits --version 0.0.21
                    
NuGet\Install-Package BeatyBit.Bits -Version 0.0.21
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BeatyBit.Bits" Version="0.0.21" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BeatyBit.Bits" Version="0.0.21" />
                    
Directory.Packages.props
<PackageReference Include="BeatyBit.Bits" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BeatyBit.Bits --version 0.0.21
                    
#r "nuget: BeatyBit.Bits, 0.0.21"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BeatyBit.Bits@0.0.21
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BeatyBit.Bits&version=0.0.21
                    
Install as a Cake Addin
#tool nuget:?package=BeatyBit.Bits&version=0.0.21
                    
Install as a Cake Tool

Useful bits of architecture and code for .NET projects

Lifetime Management (Lifetime / LifetimeDefinition)

Instead of the standard IDisposable pattern, which scales poorly across complex object hierarchies, Lifetime provides an advanced system for managing object lifecycles.

Leak Prevention

No longer need to remember to manually call Dispose() in multiple locations. A resource is simply "bound" to the current scope.

Hierarchical Structure:

Lifetime enables the creation of dependency trees. When a parent LifetimeDefinition is terminated, all child Lifetimes and their associated resources are automatically released.

Determinism:

All resources (such as files, network connections, or event subscriptions) are released predictably and in the correct order.

Path Buddy: Type-Safe Path Management

Path Buddy is a lightweight library designed to replace fragile string-based path manipulation with strongly-typed AbsolutePath and RelativePath objects. It integrates with a Lifetime system to handle temporary file cleanup automatically.

Purpose

The primary goal is to eliminate "path-string soup" and manual resource cleanup. By distinguishing between absolute and relative paths at the type level, PathBuddy prevents common bugs (like combining two absolute paths).

Intuitive Path Combining

Uses the / operator for clean, readable path joining (e.g., baseDir / "logs" / "app.log"), replacing cumbersome Path.Combine calls.

Other bits

  • Maybe monad
  • A couple of extensions for working with Dictionary:
    • GetOrCreateValue — encapsulation of often necessary action.
    • GetValueSafe — for use in places where it doesn't matter whether the value is in the Dictionary or not.
  • LeanList4 — list implementation that stores the first four elements inline and falls back to List.
  • Apply— function programming style method
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on BeatyBit.Bits:

Package Downloads
BeatyBit.Binstate

A thread-safe, hierarchical state machine library for .NET. Features include support for async methods, argument passing, state serialization, and more.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.21 81 3/17/2026
0.0.20 303 3/29/2025
0.0.19 224 3/22/2025
0.0.17 274 3/16/2025
0.0.15 208 3/16/2025
0.0.14 205 3/16/2025

# Lifetime Management (Lifetime / LifetimeDefinition)
     Instead of the standard `IDisposable` pattern, which scales poorly across complex object hierarchies, `Lifetime` provides an advanced system for managing object lifecycles.

     ## Leak Prevention
     No longer need to remember to manually call `Dispose()` in multiple locations. A resource is simply "bound" to the current scope.

     ## Hierarchical Structure:
     `Lifetime` enables the creation of dependency trees. When a parent `LifetimeDefinition` is terminated, all child `Lifetimes` and their associated resources are automatically released.

     ## Determinism:
     All resources (such as files, network connections, or event subscriptions) are released predictably and in the correct order.

     # PathBuddy: Type-Safe Path Management
     PathBuddy is a lightweight library designed to replace fragile string-based path manipulation with strongly-typed `AbsolutePath` and `RelativePath` objects. It integrates with a `Lifetime` system to handle temporary file cleanup automatically.

     ## Purpose
     The primary goal is to eliminate "path-string soup" and manual resource cleanup. By distinguishing between absolute and relative paths at the type level, PathBuddy prevents common bugs (like combining two absolute paths).

     ## Intuitive Path Combining
     Uses the / operator for clean, readable path joining (e.g., baseDir / "logs" / "app.log"), replacing cumbersome Path.Combine calls.

     # Fixes
     `LeanList` inherits IReadonlyList