These are chat archives for akkadotnet/AkkaStreams

16th
Oct 2016
Vagif Abilov
@object
Oct 16 2016 12:47
I've been playing (mostly learning) with Akka streams, and since we are using Akka with F#, I wonder if would be useful to define a special operator so source, flows and sinks could be connected using syntax similar to Scala.
For example:
let nums = seq { 11..13 }
let source = nums |> Source.From
let sink = Sink.ForEach(fun x -> printfn "%d" x)
let flow = Flow.FromFunction(fun x -> x * 2)
let runnable = source >~> flow >~> sink
F# doesn't allow binary operators to begin with ~, so it's not possible to define operator ~>, like in Scala. So I had to prefix it with extra >.
An alternative is to use something different, like =>
I wonder if it's worth having this notation in Akka.Streams for F#, since we already have F# API.