dev-master
9999999-dev
MIT
The Development Requires
functional railway railway oriented programming
v1.0
1.0.0.0
MIT
The Development Requires
functional railway railway oriented programming
Wallogit.com
2017 © Pedro PelĂĄez
This library is based on a post from (Scott Wlaschin)[https://fsharpforfunandprofit.com/posts/recipe-part2/] in order to bring Railway Oriented Programming to PHP., (*2)
Install it using Composer, (*3)
composer require martinezdelariva/railway
Typically every use case receives a request and produces a response. The use case passes for several steps until gets the final response to be returned. Handle every error scenario could be tedious and difficult to read., (*4)
In order to have a type that works with any workflow, we borrow the type Either from functional programming:, (*5)
, (*6)
This object acts as a switch, where left means failure and the right means success., (*7)
Railways have switches ("points" in the UK) for directing trains onto a different track. We can think of these âSuccess/Failureâ functions as railway switches., (*8)
, (*9)
Either) and 2 output (Either).
, (*10)
Either).
, (*11)
Please find below the list of functions which connects switch together:, (*12)
1-1 : 2-2, (*13)
Converts one track function into two track function., (*14)
, (*15)
Converts one track function into switch., (*16)
1-1 : 1-2, (*17)
, (*18)
Converts switch into two track function., (*19)
1-2 : 2-2, (*20)
, (*21)
Join two switches into another switch., (*22)
1-2 and 1-2 : 1-2, (*23)
, (*24)
Dead-function to one track function., (*25)
, (*26)
Handling exceptions. Convert one track function into switch., (*27)
1-1 : 1-2, (*28)
, (*29)
Combines switch functions in parallel., (*30)
1-2 + 1-2 : 1-2, (*31)
, (*32)
Handles both tracks, converting one track into two track function., (*33)
1-1 : 2-2, (*34)
, (*35)
MIT
functional railway railway oriented programming
MIT
functional railway railway oriented programming