Simplee.Common
1.0.7
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
<PackageReference Include="Simplee.Common" Version="1.0.7" />
paket add Simplee.Common --version 1.0.7
#r "nuget: Simplee.Common, 1.0.7"
// 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:
- Active patterns
- Error types
- 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:
- MemberOf, NotMemberOf - these partial patterns determine if a given item is a member of a given collection.
- 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:
- Negative, NegativeOrZero, Positive, PositiveOrZero - these partial patters compare a given number to 0.
- Even|Odd - the complete pattern determines whether a given number is even or odd.
- 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:
- IsNullOrWhite, IsAllCaps - the partial pattern determines if a given string is null or empty or if the string has only CAPS.
- 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 | Versions 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.0
- FSharp.Core (>= 4.3.4)
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,381 | 3/18/2018 | |
1.0.12 | 1,253 | 3/15/2018 | |
1.0.11 | 2,431 | 3/2/2018 | |
1.0.10 | 1,462 | 3/1/2018 | |
1.0.9 | 1,416 | 2/27/2018 | |
1.0.8 | 1,443 | 2/27/2018 | |
1.0.7 | 1,309 | 2/26/2018 | |
1.0.6 | 1,362 | 2/26/2018 | |
1.0.5 | 1,294 | 2/21/2018 | |
1.0.4 | 1,299 | 2/11/2018 | |
1.0.3 | 1,359 | 2/11/2018 | |
1.0.2 | 2,215 | 1/29/2018 | |
1.0.1 | 1,367 | 1/26/2018 | |
1.0.0 | 1,310 | 1/26/2018 |
Added SResult