[Haskell-beginners] splitAt and negative values

Stephen Tetley stephen.tetley at gmail.com
Thu Sep 6 23:14:09 CEST 2012


In Haskell "positional" list functions treat negative values as zero:

> take (-1) "abc"

""
> drop (-2) "xyz"

"xyz"

So, its idiomatic of splitAt to follow Haskell's precedent rather than Python's.



More information about the Beginners mailing list