[英]F# List of random numbers concatenated
Can someone tell me why this works 有人可以告诉我为什么这样做
let createRandomList = List.init 9 (fun _ -> randomNumberGenerator.Next(0,9))
let concatRandomList =
createRandomList
|> Seq.map string
|> String.concat ""
and this does not? 这不是吗?
let createConcatRandomList = List.init 9 (fun _ -> randomNumberGenerator.Next(0,9))
|> Seq.map string
|> String.concat ""
I am getting an "Incomplete value or function definition" on the second code block 我在第二个代码块上收到“不完整的值或函数定义”
Thanks in advance 提前致谢
在第二个示例中,您需要将|>
缩进到与List
相同的级别
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.