简体   繁体   中英

Is scanl1 really partial?

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?

That's a mistake on the wiki. scanl1 is in fact total. (I've updated the wiki.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM