解析错误,在两个函数上输入-Haskell

问题描述 投票:0回答:1

在这段代码中,我的编译器在该行的输入上引发解析错误

“ tuple_up parsed_int list_of_points”

“ let new_point =(((fst last_point),(snd last_point)+1)”

从关于这些错误的先前文章中,他们建议检查先前的空格,我这样做。所有行都正确地用制表符缩进。似乎此问题与第一行“ let”行之后的内容有关?

go_up :: [String] -> [(Int, Int)]
go_up string_path list_of_points =
    let parsed_int = parse_current string_path
    tuple_up parsed_int list_of_points

tuple_up :: Int -> [String] -> [(Int, Int)]

tuple_up 0 list_of_points = list_of_points
tuple_up increment list_of_points =
    let last_point = tail list_of_points
    let new_point = ((fst last_point), (snd last_point) + 1)
    let new_list_of_points = list_of_points ++ new_point
    tuple_up (increment - 1) new_list_of_points

haskell parse-error
1个回答
0
投票
do以外的地方,let突然起作用,特别是:

    需要inlet x = y in z
© www.soinside.com 2019 - 2024. All rights reserved.