
6 Sep
2012
6 Sep
'12
5:24 p.m.
Hello, Could you explain this behaviour?
splitAt (-1) "Foobar" ("","Foobar") splitAt (-100) "Foobar" ("","Foobar")
I don't understand why splitAt (-1) "Foobar" doesn't output this: ("r", "Fooba") or this: ("", "Fooba") How does it work? Python's list slicing looks similar, but results for negative values differ:
a = "Foobar" a[:-1] 'Fooba'
Thanks