map vs flatMap

  • map is a one-to-one function
    • map(f1t1) => Stream<R>
  • flatMap is a one-to-many function
    • map(f1tn) => Stream<List<R>>