[英]Is scanl1 really partial?
According to the Haskell wiki , the scanl1
function is partial. 根据Haskell wiki ,
scanl1
函数是部分的。 I don't understand what inputs result in bottom, though. 不过,我不明白输入结果是什么。 For list functions, I'm used to the problem inputs either being empty lists (like for
head
) or infinite ones (like for reverse
). 对于列表函数,我习惯了问题输入是空列表(如
head
)或无限列表(如reverse
)。 However, scanl1
seems to handle both of these types of lists correctly. 但是,
scanl1
似乎正确处理这两种类型的列表。 Is this actually a partial function? 这实际上是部分功能吗? If so, what's an example of an input that will result in bottom?
如果是这样,那么输入的一个例子是什么?
That's a mistake on the wiki. 这是维基上的一个错误。
scanl1
is in fact total. scanl1
实际上是总数。 (I've updated the wiki.) (我已经更新了维基。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.