www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Whats worth taking from "railroad oriented programming"

reply monkyyy <crazymonkyyy gmail.com> writes:
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
next sibling parent Kapendev <alexandroskapretsos gmail.com> writes:
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?
Feb 21
prev sibling next sibling parent Meta <jared771 gmail.com> writes:
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
Feb 21
prev sibling parent reply Bogdan <contact szabobogdan.com> writes:
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
Feb 27
parent reply monkyyy <crazymonkyyy gmail.com> writes:
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? ```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?
Feb 27
parent Inkrementator <invalid invalid.org> writes:
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