Simplee.IO 1.0.1

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

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

Koio |> Simple.IO

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

    open Simplee.IO

Here is the main functionality exposed:

  1. Stack free monad

1. Stack free monad and computation expression

The library exposes a free monad ofr stack operations which can be interpreted by writing the push, pop, peek, and pur functions. You can use the stk computation expression in order to generate flows which operate on the stack.

    let flow = stk {
        let! _ = stkpush 10
        let! r = stkpop ()
        let! _ = stkpeek ()
        return r
        }

The library exposes a lister for stk flows:

    flow
    |> stklst (fun () -> 10)
    |> List.iter (lstrln2str >> printfn "%s")

The library also provides an in-memory stack implementation which can execute flows:

    flow
    |> stkimrun (stkimEU ())        // start with an empty stack, without upper limit
    |> fst
    |> printfn "Stack: %O"

There are several convenience function which can create an in-memory stack: stkimEU, stkimE, stkimA where you can set the upper limit of the stack and/or the initial values in the stack.

Here is an example of the implementation for the push, pop, peek, and pur functions:

    let private push (SLister (ln, _, _) as s) v =

        (ln, "psh", v |> sprintf "%A")
        |> SLstrLn
        |> lstappnd s,

        () |> Ok

    let private pop getv (SLister (ln, _, _) as s) =

        (ln, "pop", "")
        |> SLstrLn
        |> lstappnd s, 
        
        () |> getv |> Ok

    let private peek getv (SLister (ln, _, _) as s) =
        (ln, "pek", "")
        |> SLstrLn
        |> lstappnd s, 
        
        () |> getv |> Ok

    let private pur (SLister (ln, _, _) as s) v =
        (ln, "pur", v |> sprintf "%A")
        |> SLstrLn
        |> lstappnd s, 

        v |> Ok

2. Installation

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

PM> Install-Package Simplee.IO -Version 1.0.0
> dotnet add package Simplee.IO --version 1.0.0 
> paket add Simplee.IO --version 1.0.0
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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.50 1,144 5/30/2018
1.0.8 952 3/14/2018
1.0.7 938 3/2/2018
1.0.6 983 3/2/2018
1.0.5 955 3/2/2018
1.0.4 932 3/2/2018
1.0.3 932 3/1/2018
1.0.2 946 2/27/2018
1.0.1 948 2/27/2018
1.0.0 950 2/26/2018

Added an in-memory stack and started using the SError from Simplee.Common package