FPrimitive

open FPrimitive

/// Composible specifications for your domain types:
type NonEmptyString =
    private
    | NonEmptyString of string
    static member create x =
        Spec.def<string>
        |> Spec.notNull "should not be null"
        |> Spec.notEmpty "should not be empty"
        |> Spec.createModel NonEmptyString x

/// ...also available as computation expression.
type NonEmptyList<'a> =
    private
    | NonEmptyList of 'a list
    static member create xs =
        specModel NonEmptyList xs {
            nonEmpty "list should not be empty"
            lengthBetween 1 10 "list length should be between 1-10"
        }


/// Access controllers for your critical application resources:
let uncontrolled_critical = ignore

let critical =
    Access.func uncontrolled_critical
    |> Access.once
    |> Access.duringHours 9 17
    |> Access.revokable

/// Try to evaluate
Access.eval () critical
/// Revoke when neccessary
Access.revoke

The library comes with comprehensible documentation about the major parts of the project and the complete API reference of the project:

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.

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.

Icons made by Vectors Market from www.flaticon.com is licensed by CC 3.0.