According to the Haskell wiki, the scanl1
function is partial. 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
). However, scanl1
seems to handle both of these types of lists correctly. Is this actually a partial function? If so, what's an example of an input that will result in bottom?
Asked
Active
Viewed 118 times
5

Joseph Sible-Reinstate Monica
- 45,431
- 5
- 48
- 98
-
1From the [source](http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.List.html#scanl1), it doesn't look partial. Everything seems to be correctly handled. – Fyodor Soikin Feb 07 '19 at 16:45
1 Answers
8
That's a mistake on the wiki. scanl1
is in fact total. (I've updated the wiki.)

Li-yao Xia
- 31,896
- 2
- 33
- 56