Thread overview
Whats worth taking from "railroad oriented programming"
Feb 21
monkyyy
Feb 21
Kapendev
Feb 22
Meta
4 days ago
Bogdan
3 days ago
monkyyy
20 hours ago
Inkrementator
February 21

https://www.youtube.com/watch?v=srQt1NAHYC0

The guy has nice pictures, but... I havnt seen it in a nonfunctional language

In theory I want ranges + nullable to be smarter but; idk I dont know what to call it

February 21

On Friday, 21 February 2025 at 04:29:25 UTC, monkyyy wrote:

>

https://www.youtube.com/watch?v=srQt1NAHYC0

The guy has nice pictures, but... I havnt seen it in a nonfunctional language

In theory I want ranges + nullable to be smarter but; idk I dont know what to call it

No idea, I just code like it's C and it usually works great. C oriented design maybe?

February 22

On Friday, 21 February 2025 at 04:29:25 UTC, monkyyy wrote:

>

https://www.youtube.com/watch?v=srQt1NAHYC0

The guy has nice pictures, but... I havnt seen it in a nonfunctional language

In theory I want ranges + nullable to be smarter but; idk I dont know what to call it

You can do pretty much the exact same stuff in Java using the Stream API. You don't need a functional language

4 days ago

On Friday, 21 February 2025 at 04:29:25 UTC, monkyyy wrote:

>

https://www.youtube.com/watch?v=srQt1NAHYC0

The guy has nice pictures, but... I havnt seen it in a nonfunctional language

In theory I want ranges + nullable to be smarter but; idk I dont know what to call it

I tried to do something like that with this either monad implementation. Have a look if you’re interested https://github.com/gedaiu/either

3 days ago

On Thursday, 27 February 2025 at 10:15:18 UTC, Bogdan wrote:

>

On Friday, 21 February 2025 at 04:29:25 UTC, monkyyy wrote:

>

https://www.youtube.com/watch?v=srQt1NAHYC0

The guy has nice pictures, but... I havnt seen it in a nonfunctional language

In theory I want ranges + nullable to be smarter but; idk I dont know what to call it

I tried to do something like that with this either monad implementation. Have a look if you’re interested https://github.com/gedaiu/either

Why does either have space for both values? Is that important?

struct Either(T,S){
  T t;
  S s;
  bool which;
  ...

Shouldnt this by an alias of sumtype?
is either to pair as symtype is to tuple?

20 hours ago

On Thursday, 27 February 2025 at 21:37:12 UTC, monkyyy wrote:

>

Why does either have space for both values? Is that important?
Shouldnt this by an alias of sumtype?
is either to pair as symtype is to tuple?

Conceptually, Either is a tagged union/ sumtype similar to Nullable, but instead of the value null to signal that something went wrong, you can define an arbitrary error type, i.e. a string which is the error messages.