Closed
Description
Currently list::head/tail call "fail" when the list is empty.
Haskell's head/tail do the same and it causes a lot of grief: http://www.reddit.com/r/haskell/comments/lf71l/deprecate_preludehead_and_partial_functions/
I suggest to either
a) make the return type an "option"
b) add a "is_not_empty" predicate, similar to vec::head/tail
b) is probably more Rust-nic.
Metadata
Metadata
Assignees
Labels
No labels