scalaz/scalaz — pull request #611 by tpolecat (2013-12-21 06:12:40+00:00)
Title: IList: safe, invariant cons list

`IList` is an invariant cons list, generally equivalent to stdlib `List` but without unsafe methods and other stdlib nonsense.

Included in this PR:

- `IList` with functional equivalents for most of the stdlib `List` operations, plus the same set of typeclass instances that we provide for stdlib `List`.
- Tests for typeclass laws, for consistency of "bonus" methods (`intersperse`, `mapAccumLeft`, etc.), and for consistency of remaining operations with their equivalents on stdlib `List`.
- A very short `IListUsage` example.

Considerations:

- I'm a new contributor and this is a lot of code.
- Is this useful? `List` has plenty of problems that will *never* be fixed, but on the other hand it's used everywhere. Will anyone bother to use `IList`?
- Is the timing bad? Paulp has a new collection library in the works that might make this and some other scalaz data structures irrelevant. Dunno.
- Some methods (especially more obscure ones) are clearly not optimal; my intent is to revisit perf in a followup.