gpt4 book ai didi

Haskell 列出了不同之处

转载 作者:行者123 更新时间:2023-12-03 13:45:44 25 4
gpt4 key购买 nike

我正在尝试使列表有所不同。直接找到前奏运算符\\\\这使得列表有所不同。但是错误 Not in scope: '\\\\'发生。这是我的简单命令行解释器:

Prelude>  ([1,2,3] ++ [5,6])   -- works like expected
[1,2,3,4,5,6]

prelude> ([1,2,3] \\\\ [1,2]) -- erros occurs
<interactive>:1:11: Not in scope: "\\\\"

感谢您解释我犯错的地方。

最佳答案

它是 \\ ,而不是 \\\\ .您还需要import Data.List .

Prelude List> import Data.List
Prelude List> ([1,2,3] \\ [1,2])
[3]

关于Haskell 列出了不同之处,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4573692/

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