Focal.Core 0.9.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Focal.Core --version 0.9.3
                    
NuGet\Install-Package Focal.Core -Version 0.9.3
                    
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="Focal.Core" Version="0.9.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Focal.Core" Version="0.9.3" />
                    
Directory.Packages.props
<PackageReference Include="Focal.Core" />
                    
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 Focal.Core --version 0.9.3
                    
#r "nuget: Focal.Core, 0.9.3"
                    
#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 Focal.Core@0.9.3
                    
#: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=Focal.Core&version=0.9.3
                    
Install as a Cake Addin
#tool nuget:?package=Focal.Core&version=0.9.3
                    
Install as a Cake Tool

Focal

Lenses/Prisms/Traversals/etc. with an emphasis on usability in the F# programming environment

classDiagram
    `IFold<'s,'a>` <|-- `IGetter<'s,'a>`
    `ISetter<'s,'t,'a,'b>` <|-- `ITraversal<'s,'t,'a,'b>`
    `IFold<'s,'a>` <|-- `ITraversal<'s,'t,'a,'b>`
    `ITraversal<'s,'t,'a,'b>` <|-- `ILens<'s,'t,'a,'b>`
    `IGetter<'s,'a>` <|-- `ILens<'s,'t,'a,'b>`
    `ITraversal<'s,'t,'a,'b>` <|-- `IPrism<'s,'t,'a,'b>`
    
    class `IFold<'s,'a>` {
        ToSeq: ('s) -> seq<'a>
        ComposeWith: (IFold<'a,'b>) -> IFold<'s,'b>
    }
    class `ISetter<'s,'t,'a,'b>` {
        Over: ('a -> 'b) -> 's -> 't
        ComposeWith: (ISetter<'a,'b,'c,'d>) -> ISetter<'s,'t,'c,'d>
    }
    class `IGetter<'s,'a>` {
        Get: ('s) -> 'a
        ComposeWith: (IGetter<'a,'b>) -> IGetter<'s,'b>
    }
    class `ITraversal<'s,'t,'a,'b>` {
        ComposeWith: (ITraversal<'a,'b,'c,'d>) -> ITraversal<'s,'t,'c,'d>
    }
    class `ILens<'s,'t,'a,'b>` {
        ComposeWith: (ILens<'a,'b,'c,'d>) -> ILens<'s,'t,'c,'d>
    }
    class `IPrism<'s,'t,'a,'b>` {
        Which: ('s) -> Result<'a,'t>
        Unto: ('b) -> 't
        ComposeWith: (IPrism<'a,'b,'c,'d>) -> IPrism<'s,'t,'c,'d>
    }

Design Goals

The purpose of this project is to create an optics library that fits as well as possible into idiomatic F# code. This is largely accomplished by a combination of an explicitly defined interface hierarchy for the main optics types, and complimented by extension methods to allow for composing optics using a Fluent-like interface. The instances of said interfaces are implemented as records of matching fuctions. This is a large departure from the lens or optics libraries in Haskell. In exchange for a reduced level of expressiveness, we are able to make heavy use of the auto-complete features available for F# in VSCode and Visual Studio.

Examples

JSON Examples

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Focal.Core:

Package Downloads
FsGrpc.Tools

gRPC and Protocol Buffer compiler for F# projects

Focal.Json

Lenses/Prisms/Traversals/etc. for FSharp.Data.JsonValue types

FsGrpc.ProtocGenFsGrpc

Code generation for idiomatic F# code generation from protocol buffers

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.10.0 3,904 3/21/2024
0.9.3 2,335 5/10/2023
0.9.2 7,290 5/9/2023