> the only issue with java in this context is that you'll need to create a new class/transfer object between each function call that does things
No, in most cases you don't. The stream interface is mostly designed around simple Lists, Sets and Maps. It also interacts very well with the Collection framework (e.g. myHashmap.entrySet() yielding a set, etc.) which is part of the standard library.
You can extend streams with custom collectors, but rarely if ever you need to define intermediate data structures. You do need to define initial and terminal structures, but I'd argue that's good practice regardless.
that lets you pass the result from each function to the next without explicitly stating what form they have, yes.
You'll still be missing the conciseness/explicitness because the language isn't meant to be used like that and is missing necessary features in order to facilitate it such as pattern matching by the passed in values into function.
to make a simple example, you could theoretically write the following pseudo-code
def sendEmail({email}) do
// send email
end
def sendEmail({id}) do
// get email address
sendEmail({email})
end
sendEmail({id: 244})
or to make sure your code stops executing if an error occurs (positional return values this time)
No, in most cases you don't. The stream interface is mostly designed around simple Lists, Sets and Maps. It also interacts very well with the Collection framework (e.g. myHashmap.entrySet() yielding a set, etc.) which is part of the standard library.
You can extend streams with custom collectors, but rarely if ever you need to define intermediate data structures. You do need to define initial and terminal structures, but I'd argue that's good practice regardless.