swlaschin / Railway-Oriented-Programming-Example

This repository contains code that demonstrates the "Railway Oriented Programming" concept for error handling in functional programming languages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parallelism

Bombe opened this issue · comments

In your talk (great talk, by the way) you mentioned combining several validators into a kind of parallel validator. However, for that to work (and to be able to tell you that neither name nor email address are allowed to be blank) you would need to collect failures in a list, wouldn’t you? I don’t see that reflected in the code so I’m wondering whether I’m wrong about this or whether it simply doesn’t exist in the code. :)

Hi David,

Yes, I do mention it here: http://www.slideshare.net/ScottWlaschin/railway-oriented-programming/138. And you're right, the answer is have the failure part be a list rather than a single error.

I didn't go into detail on how to do this in the talk, but the example code shows how it works:

The use of <!> and <*> symbols is explained in much more detail in this other post:

Hope that helps!

-- Scott

Yes, I believe it does help. Thank you!