Re:Destroy All Ifs – A Perspective from Functional Programming
by dllthomas on Saturday July 23, 2016 @12:11AM
(#12148297)
Apart from what you mention, it's often not possible to pass along all of the multiple return values as a single value.
Re:Destroy All Ifs – A Perspective from Functional Programming
by harveywi on Sunday July 17, 2016 @09:32AM
(#12110109)
The difference, in terms of type theory, is that a tuple is a product type [1] but a type representing multiple possible return values (to represent different outcomes) would be encoded using a sum type [2].
Re:Destroy All Ifs – A Perspective from Functional Programming
by eru on Monday July 18, 2016 @06:45AM
(#12114265)
I don't think eg Go uses a sum type:
https://gobyexample.com/multiple-return-values
Typically they use product types to simulate sum types.
(Apart from that languages with multiple return values tend to have some special syntax for binding only the first few members of the returned tuple?)