gpt4 book ai didi

f# - 涉及 “Expected incomplete structured construct”的级联错误

转载 作者:行者123 更新时间:2023-12-02 10:44:35 41 4
gpt4 key购买 nike

给出以下代码:

namespace Backend

open System
open System.Linq
open Npgsql

module helpers =
let rec second_elms lst =
match lst with
| [] -> []
| (d,o)::xs -> o::(second_elms xs)

let folder acc elm =
let result_list,acc_to_substract = acc
result_list::(elm-acc_to_substract),elm

type ChartManager() =

static member ConvertOutputNumbersToDifferenceSegments(listOfOutputValuesForADay: list<DateTime*int>) =

let secs = helpers.second_elms listOfOutputValuesForADay

let trans = List.fold
helpers.folder
([],snd(secs.First()))
secs.Tail

let sndDateTime = fst(listOfOutputValuesForADay.ElementAt(1))

for each_output in fst(trans) do
yield (sndDateTime,each_output)

这给了我很多错误,但是我想大多数只是“trans”块中主要错误的级联错误,它表示(突出显示 helpers):

Unexpected identifier in binding. Expected incomplete structured construct at or before this point or other token.



这是什么意思??

最佳答案

正确缩进简单语法

 let trans = 
List.fold
helpers.folder
([],snd(secs.First()))
secs.Tail

要么
 let trans = List.fold
helpers.folder
([],snd(secs.First()))
secs.Tail

如果是单个语句,则要在多行上拆分,您需要缩进传递语句的开头。

关于f# - 涉及 “Expected incomplete structured construct”的级联错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22572453/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com