在这段代码中,我的编译器在该行的输入上引发解析错误
“ 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
do
以外的地方,let
突然起作用,特别是:in
:let x = y in z