On Monday, 12 January 2015 at 09:31:25 UTC, Walter Bright wrote:
On 1/11/2015 11:53 PM, Tobias Pankrath wrote:
On Monday, 12 January 2015 at 00:51:25 UTC, Walter Bright wrote:
This matters very much for pipeline style programming (i.e. ranges and
algorithms).

Here is one approach to it: http://fsharpforfunandprofit.com/posts/recipe-part2/

I don't fully understand it, but it appears to require that each component have two paths coded into it - the regular path, and the error path, and there has to be adapters for components that only have a regular path. Exceptions means only one path has to be coded.

As far as I understand is, it requires each component to settle on the same discriminated union that packs the error and result, which he calles Result but is usually Choice in F#.

Now in D we use the opDot to chain components, which works since we have UFCS. In F# there a simply three different opDots: >>, >>= and >=> which take care of the adaption.

Reply via email to