Create generic Scala collections with CanBuildFrom http://www.michaelpollmeier.com/create-generic-scala-collections-with-canbuildfrom/ … #Scala #Blog
-
-
Replying to @pollmeier
@pollmeier@ryanlecompte what about map on structures that are not Iterable, or even nothing like collections at all?1 reply 0 retweets 0 likes -
Replying to @dibblego
@dibblego@ryanlecompte well all you need is the CanBuildFrom factory. No need for Iterable or anything collection like ;)1 reply 0 retweets 0 likes -
Replying to @pollmeier
@pollmeier@ryanlecompte but then I must implement methods that are not sensible for my "thing with map."1 reply 0 retweets 0 likes -
Replying to @dibblego
@dibblego@ryanlecompte all you need to implement is CanBuildFrom, which essentially needs a new Builder. looks quite sensible to me...2 replies 0 retweets 0 likes -
Replying to @pollmeier
@pollmeier@ryanlecompte There are a bazillion things with a map method, as it is well defined, but are not collections. Still sensible?1 reply 0 retweets 0 likes -
Replying to @pollmeier
@pollmeier I think you are missing the point. There are sensible abstractions out there that subsume the CanBuildFrom nonsense.2 replies 0 retweets 0 likes
@pollmeier map is on List[A] taking (A => B) returning List[A]. andThen is on Function1[T, A] taking (A => B) returning Function1[T, A].
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.