flatMap or flatten

Isiah Meadows isiahmeadows at gmail.com
Thu Jun 8 06:27:18 UTC 2017


Eh, not exactly. Scala uses a more general version that works with any
monadic type (`flatMap` is technically a monadic bind, and `flatten` a
monadic join), while this is roughly equivalent to
`[].concat(...array.map(func))` or `_.flatten(_.map(array, func))`.

On Tue, Jun 6, 2017, 07:02 Igor Baklan <io.baklan at gmail.com> wrote:

> +1
>
> Good step toward (`JS` <= [`Scala`](
> https://www.scala-lang.org/documentation/) ) unification. ( [flatMap](
> https://www.scala-lang.org/api/current/scala/collection/TraversableLike.html#flatMap[B](f:A=>scala.collection.GenTraversableOnce[B]):Traversable[B])
> , [flatten](
> https://www.scala-lang.org/api/current/scala/collection/generic/GenericTraversableTemplate.html#flatten[B]:Traversable[B])
> )
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170608/1271a087/attachment-0001.html>


More information about the es-discuss mailing list