函数无法成为返回值F#

时间:2014-01-28 10:21:54

标签: xml function f# f#-data

我的函数参数有问题:

let createWorkflowList (scenario : ScenarioConfiguration.DomainTypes.ScenarioConfiguration) =
let arrayWorkflow = Array.create (scenario.Workflows.GetWorkflows().Length) emptyWorkflow
let workflowRow = ref 0
for workflow in scenario.Workflows.GetWorkflows() do
    let workflowInfo =
       {
            Id = workflow.Id
            RunType = workflow.RunType
            TestType = workflow.TestType
        }
    arrayWorkflow.[!workflowRow] <- workflowInfo
    incr workflowRow
List.ofArray arrayWorkflow

let workflowList = createWorkflowList (XmlReader.ScenarioConfiguration.DomainTypes.ScenarioConfiguration)

问题出现在createWorkflowList的参数上。

以下是该方案:

[<Literal>]
let scenarioConfig = """
    <ScenarioConfiguration ScenarioName="structure">
        <Coefficient>true</Coefficient>
    <Reagents>
    <Reagent TrackPos="1" TubePos="1" Type="ABC" />
    <Reagent TrackPos="2" TubePos="2" Type="DEF" ReservoirType="12345678AA" />
    </Reagents>
    <Consumable DwpType="EG" MwpType="AD">
    <TipRackPosition>16</TipRackPosition>
    <TipRackPosition>34</TipRackPosition>
    </Consumable>
    <Samples StartTrackPositions="10">
            <Sample Test="HBV" SampleMatrix="DilutedSerumOrPlasma" Number="5" />
            <Sample Test="HBV" SampleMatrix="DilutedSerumOrPlasma" Number="5" />
    </Samples>
    <Workflows>
        <Workflow Id="4b5d8db9-cb3b-446c-96ed-ca6bc6f36b9a" RunType="Full" TestType="HBV" />
        <Workflow Id="a53b74ec-7fa0-41ad-9670-30f2b204f27f" RunType="Full" TestType="HCV" />
        <Workflow Id="2ccb5b0f-1df7-4f84-8ee9-3c46d996d203" RunType="Full" TestType="HIV-1" />
    </Workflows>
</ScenarioConfiguration>"""

type ScenarioConfiguration = XmlProvider<Sample = scenarioConfig>

有人可以帮我找到解决方案,如何更改功能或调用功能?

0 个答案:

没有答案