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 compound methods when building flow expression #1

@msdvoits

Description

@msdvoits
let ``Building compound method with 2 outputs from work expression``() =
    let incsum (x: ArtefactExpression<int>) (y: ArtefactExpression<int>) : FlowExpression<ArtefactExpression<int>*ArtefactExpression<int>> =
        flow {
            let! a = inc x
            let! b = sum (collect[| a; y |])
            return a,b 
        }

    let makeIncsum = decl incsum "incsum values" |> carg "x" |>carg "y" |> cresult ["a";"b"]
    let contract = Angara.Contracts.getContract makeIncsum

    let w = work{
        let! a,b = makeIncsum (value 2) (value 5)
        return a,b
    }

    match eval2 w |> Async.RunSynchronously with
    | EvaluationResult.Success (a,b) -> 
        (3,8) =? (a,b)
    | EvaluationResult.Failed _ -> Assert.Fail("Work failed")

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