Skip to content
This repository was archived by the owner on Jul 4, 2024. It is now read-only.
This repository was archived by the owner on Jul 4, 2024. It is now read-only.

Support for resumable iterative function in MethodDecl #3

Description

let ``Use resumable iterative method in a 'work' monad``() =
        let g = work {
            let! func    = makeValue (fun (x:float) -> x*x - 4.*x + 2.)
            let! settings= makeValue (3.0, 0.1, 0.001)
            let! root    = root (func, settings)
            return! incf root
        } 
        match eval(g) |> Async.RunSynchronously with
        | EvaluationResult.Failed  _ -> Assert.Fail("Failed to execute a work")
        | EvaluationResult.Success(v) -> Assert.AreEqual(1. + (2. + sqrt(2.)), v, 0.01, "Incorrect root")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions