[akka-user] Re: Akka Streams Merge variance

2015-05-23 Thread Oliver Winks
Thanks Johannes, didn't realize the inlets have different variance to the merge.

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: Akka Streams Merge variance

2015-05-19 Thread Viktor Klang
Thinking about it perhaps it makes sense to have a MergeWith, where Merge
is using the identity function?

-- 
Cheers,
√
On 19 May 2015 02:10, Andrey Kuznetsov f...@loathing.in wrote:

 I asked myself the same question when I faced to the problem of merging
 elements from Source[A] and Source[B] where A and B are children of the
 same trait C. Had to make both sources a Source[C].

 On Saturday, May 16, 2015 at 4:47:51 PM UTC+3, Oliver Winks wrote:

 If you look at the implementation of Merge you find that it is a generic
 type, but without any defined variance:

 classMerge[T] extends Graph
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/Graph.html
 [UniformFanInShape
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/UniformFanInShape.html
 [T, T], Unit http://www.scala-lang.org/api/2.10.5/index.html#scala.Unit
 ]

 Is there any reason for this? Would it not make sense to define it as a
 covariant type? e.g:

 classMerge[+T] extends Graph
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/Graph.html
 [UniformFanInShape
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/UniformFanInShape.html
 [T, T], Unit http://www.scala-lang.org/api/2.10.5/index.html#scala.Unit
 ]

  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to the Google Groups
 Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Re: Akka Streams Merge variance

2015-05-18 Thread Andrey Kuznetsov
I asked myself the same question when I faced to the problem of merging 
elements from Source[A] and Source[B] where A and B are children of the 
same trait C. Had to make both sources a Source[C].

On Saturday, May 16, 2015 at 4:47:51 PM UTC+3, Oliver Winks wrote:

 If you look at the implementation of Merge you find that it is a generic 
 type, but without any defined variance:

 classMerge[T] extends Graph 
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/Graph.html
 [UniformFanInShape 
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/UniformFanInShape.html
 [T, T], Unit http://www.scala-lang.org/api/2.10.5/index.html#scala.Unit]

 Is there any reason for this? Would it not make sense to define it as a 
 covariant type? e.g:

 classMerge[+T] extends Graph 
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/Graph.html
 [UniformFanInShape 
 http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-RC2/akka/stream/UniformFanInShape.html
 [T, T], Unit http://www.scala-lang.org/api/2.10.5/index.html#scala.Unit]



-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.