FSharpPlus


FSharpPlus

Documentation

The FSharpPlus library can be installed from NuGet:
PM> Install-Package FSharpPlus

Example 1

This example demonstrates using a function defined in this library.

1: 
2: 
3: 
4: 
5: 
#r @"../../src/FSharpPlus/bin/Release/net45/FSharpPlus.dll"
open FSharpPlus

let x = String.replace "old" "new" "Good old days"
// val x : string = "Good new days"

Example 2

This example demonstrates using a generic function defined in this library.

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
map string [|2;3;4;5|]
// val it : string [] = [|"2"; "3"; "4"; "5"|]

map ((+) 9) (Some 3)
// val it : int option = Some 12

open FSharpPlus.Data

map string (NonEmptyList.create 2 [3;4;5])
// val it : NonEmptyList<string> = {Head = "2"; Tail = ["3"; "4"; "5"];}

Some more info

Samples & documentation

The library comes with comprehensible documentation. It include tutorials automatically generated from *.fsx files in the content folder. The API reference is automatically generated from Markdown comments in the library implementation.

  • Tutorial contains a further explanation of this library.

  • Abstractions contains detailed information about all the abstractions represented in this library.

  • Computation Expressions contains information about the generic computation expressions.

  • API Reference contains automatically generated documentation for all types, modules and functions in the library. This includes additional brief samples on using most of the functions.

Contributing and copyright

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding a new public API, please also consider adding samples that can be turned into a documentation. You might also want to read the library design notes to understand how it works.

The library is available under Public Domain license, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.

namespace FSharpPlus
val x : string
Multiple items
module String

from FSharpPlus

--------------------
module String

from Microsoft.FSharp.Core
val replace : oldValue:string -> newValue:string -> source:string -> string
val map : f:('T -> 'U) -> x:'Functor<'T> -> 'Functor<'U> (requires member Map)
Multiple items
val string : value:'T -> string

--------------------
type string = System.String
union case Option.Some: Value: 'T -> Option<'T>
namespace FSharpPlus.Data
Multiple items
module NonEmptyList

from FSharpPlus.Data

--------------------
type NonEmptyList<'t> =
  {Head: 't;
   Tail: 't list;}
    interface IReadOnlyList<'t>
    interface IReadOnlyCollection<'t>
    interface IEnumerable
    interface IEnumerable<'t>
    member GetSlice : (int option * int option -> NonEmptyList<'t>)
    member Item : (int -> 't)
    member head : 't
    member tail : 't list
    static member Duplicate : s:NonEmptyList<'a> * _impl:Duplicate -> NonEmptyList<NonEmptyList<'a>>
    static member Extract : NonEmptyList<'t> -> 't
    ...
val create : x:'a -> xs:'a list -> NonEmptyList<'a>
Fork me on GitHub