Simplee.Common 1.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Simplee.Common --version 1.0.7
NuGet\Install-Package Simplee.Common -Version 1.0.7
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="Simplee.Common" Version="1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Simplee.Common --version 1.0.7
#r "nuget: Simplee.Common, 1.0.7"
#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.
// Install Simplee.Common as a Cake Addin
#addin nuget:?package=Simplee.Common&version=1.0.7

// Install Simplee.Common as a Cake Tool
#tool nuget:?package=Simplee.Common&version=1.0.7

Komo |> Simple.Common

Library Simplee.Common v1.0.7 implements common functionality used by all other Simple projects. The namespace of the library is Simplee.

    open Simplee

Here is the main functionality exposed:

  1. Active patterns
  2. Error types
  3. Result monad

Find below more details about each class of functionality.


1. Active Patterns

The library implements different partial and complete active patterns:

1.1. Collections

You can use the following partial active patterns:

  1. MemberOf, NotMemberOf - these partial patterns determine if a given item is a member of a given collection.
  2. SeqDoesContain, SeqNotContains - these partial patterns determine whether a given collection contains or not a given item.
    let is2Or3 = function
        | MemberOf [2;3] -> "x is a member of the collection"
        | _              -> "x is not a member of the collection"

    let doesContain2 = function
        | SeqContains 2 true -> "ns does contain the item 2"
        | _                  -> "ns does not contain the item 2"

1.2. Compare

You can use the following partial active patterns: EqualToN, LessThanN, LessOrEqualToN, GreaterThanN, GreaterOrEqualThanN.

    let isSmallerThan4 = function
        | LessThanN 4 -> "n is less than 4"
        | _           -> "n is greater or equal than 4"

1.3. Numerals

There are couple of classes of active patterns related to numerals:

  1. Negative, NegativeOrZero, Positive, PositiveOrZero - these partial patters compare a given number to 0.
  2. Even|Odd - the complete pattern determines whether a given number is even or odd.
  3. IsMultipleOfN - this partial pattern determine whether a given number if a multiple of a given pivot N. The library exposes several convenience partial patterns for specific pivot values: IsMultipleOf2, IsMultipleOf3, IsMultipleOf4, IsMultipleOf8, IsMultipleOf10, IsMultipleOf16.
    let isMultipleOf2 = function
        | IsMultipleOf2 -> "n is multiple of 2"
        | _             -> "n is not multiple of 2"


    let isMultipleOf80 = functions
        | IsMultipleOf8 & IsMultipleOf10 -> "n is multiple of 8 and 10"
        | _                              -> "n is not multiple of both 8 and 10"
1.3. String

The library exposes couple of classes of active patterns related to string:

  1. IsNullOrWhite, IsAllCaps - the partial pattern determines if a given string is null or empty or if the string has only CAPS.
  2. Parsing patterns - these partial patterns can be used in order to attempt parsing a given string and get an integer, or a bool, or a Date value. The patterns are: IsInt, IsBool, IsDate.
    let strToInt = function
        | IsInt n -> "The input string is an integer"
        | _       -> "The input string is not an integer"

2. Error Types

The library implements an error type which is used by all other Simple projects. The error type encapsulates correlation information, unique identifier of the error, optional message, and the location in the source file.

    type SError =
        private
        | SErr of kor:SErrKor * id:SErrId * msg:(SErrMsg option) * loc:SErrLoc
        | SSuc of kor:SErrKor * id:(SErrId option)               * loc:(SErrLoc option)

The library exposes several convenience functions which allow the user create error or success instances.

    let err = serr an id kor msg fn ln
    let suc = ssuc an id kor fn ln

    let ok = sok

3. Result Monad


4. Installation

You can install the Simplee.Common nuget package by using one of the following commands:

PM> Install-Package Simplee.Common -Version 1.0.7
> dotnet add package Simplee.Common --version 1.0.7 
> paket add Simplee.Common --version 1.0.7
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. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 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 Simplee.Common:

Package Downloads
Simplee.Goa

Lambda calculus implementation using FSharp. The library exposes the classic combinators, boolean algebra, numeral agebra using Church numerals, pairs algebra. Combinators: S, K, I, M, KI, C, B, Th, B1, V Boolean: GTrue, GFalse, GAnd, GOr, GBeq Numerals: G0, G1, G2, GSucc, GPred, GAdd, GSum, GMul, GPow, LEq, Eq, Gr Pairs: GPair, GFst, GSnd, GPhi

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.13 1,290 3/18/2018
1.0.12 1,166 3/15/2018
1.0.11 2,284 3/2/2018
1.0.10 1,373 3/1/2018
1.0.9 1,342 2/27/2018
1.0.8 1,353 2/27/2018
1.0.7 1,225 2/26/2018
1.0.6 1,288 2/26/2018
1.0.5 1,207 2/21/2018
1.0.4 1,217 2/11/2018
1.0.3 1,283 2/11/2018
1.0.2 2,063 1/29/2018
1.0.1 1,289 1/26/2018
1.0.0 1,230 1/26/2018

Added SResult