Pipes and filters – the Scala version