Compare API

Stream is like an Iterator with mostly same methods. However, there are 2 reasons why they are not completely same:

  • Iterator shares parents with eager collections, thus there are some methods which do not make sense for Iterator, like size, foldRight, patch, etc. Stream does not need to compromise
  • Iterator tries to comply with feature set of a general Scala collection, Stream implements everything what seems convenient with room to double method count in future

Following Iterator methods have custom match to Stream: