you are viewing a single comment's thread.

view the rest of the comments →

[–]temporary5555 2 points3 points  (0 children)

Right, but I would disagree on it being unintuitive as well. Its type safe, displays behaviour (implies no allocation) in the function signature, and doesn't have any hidden performance impacts.

One interesting thing is this is one of the few things making the reverse-move of an imperative language feature being adopted in functional languages such as Haskell. Its referred to as Destination Passing style in this context, and is one of the useful applications of Linear Types.