digitalmars.D - Whats worth taking from "railroad oriented programming"
- monkyyy (5/5) Feb 20 https://www.youtube.com/watch?v=srQt1NAHYC0
- Kapendev (3/8) Feb 21 No idea, I just code like it's C and it usually works great. C
- Meta (3/8) Feb 21 You can do pretty much the exact same stuff in Java using the
- Bogdan (4/9) Feb 27 I tried to do something like that with this either monad
- monkyyy (11/22) Feb 27 Why does either have space for both values? Is that important?
- Inkrementator (5/8) Mar 02 Conceptually, `Either` is a tagged union/ sumtype similar to
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
Feb 20
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 itNo idea, I just code like it's C and it usually works great. C oriented design maybe?
Feb 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 itYou can do pretty much the exact same stuff in Java using the Stream API. You don't need a functional language
Feb 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 itI tried to do something like that with this either monad implementation. Have a look if you’re interested https://github.com/gedaiu/either
Feb 27
On Thursday, 27 February 2025 at 10:15:18 UTC, Bogdan wrote:On Friday, 21 February 2025 at 04:29:25 UTC, monkyyy wrote:Why does either have space for both values? Is that important? ```d 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?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 itI tried to do something like that with this either monad implementation. Have a look if you’re interested https://github.com/gedaiu/either
Feb 27
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.
Mar 02