3 ms·
It's not quite the same thing ... the either type is just a simple value which you can think about as just having a boolean saying "is this a successful or unsu
by danielrbradley 8y ago
It's not quite the same thing ... the either type is just a simple value which you can think about as just having a boolean saying "is this a successful or unsuccessful result?", and depending on the success attach different data. E.g. a result of parsing JSON from a string would be "successful: true + the parsed object" or "successful: false + the error message".
The railway oriented approach is then looking at neat ways of working with these kind of results in the place of try/catch when dealing with errors.