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 importing artefacts from another flow expression using "import" and "take" operations #2

Description

let ``Extend and continue work using computation expression``() =
    let w1 = work {
        let! x = makeValue 1 |> name "one"
        let! y = inc x
        let! z = inc x 
        let! w = add(x,y) |> name "sum"
        ()
    }
    let eng,names,annotations,_ = startFrom_x w1 (createDefaultSuffix)
    let wrk = Execution.EngineAPI.AwaitCompletion eng |> Async.RunSynchronously
    eng.Dispose()

    Trace.WriteLine("\n\n\nContinues...")
    let snapshot = wrk, names, annotations
    let w2 = work {
        let! y = snapshot |> take<int> "out one"
        let! w = snapshot |> take<int> "out sum"
        let! z = inc y
        return z
    }

    let (g,_,_) = build w2 
    Assert.AreEqual(4, g.Structure.Vertices.Count)

    match eval w2 |> Async.RunSynchronously with
    | EvaluationResult.Failed _ -> failwith "Work failed"
    | EvaluationResult.Success z -> 
        z =? 3

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions