-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
railroad oirented programming #96
Comments
I am open to both PRs and feature requests. If this is intended to be a feature request, it would be helpful if you could describe the specific feature(s) you are requesting in more detail. If you are just asking permission to submit a PR, then go ahead, and I'll close this issue as completed. |
Its a mix of both feature requests and offer to write code Thinking in pictures from this guy: https://fsharpforfunandprofit.com/rop/ a range of sumtype is a row of train tracks route - reordering and possibly combining the tracks my last version of syntax tests had this code enum maxsizeof(T...)=24;//todo impliment after standardizing some algorthims
struct tagunion(T...){
ubyte[maxsizeof!T] data;
ubyte classify;
enum classmax=T.length;
ref S intpertivecast(S)()=>*cast(S*)(&data);
ref get(int I)()=>intpertivecast!(T[I]);
//void set(int I)(T[I] a){intpertivecast!(T[I])=a;classify=I;}
void get(int I)(T[I] a){intpertivecast!(T[I])=a;classify=I;}
} The striking differences are the get!T vs get!int and duplicate types are innately working. I think your it also had a helper function for use case of duplicate types auto part(alias F,int max,T)(T t){
tagunion!(repeat!(max,T)) o;
o.get!0=t;
o.classify=cast(ubyte)F(t);
return o;
} if sumtype stays innately undupicated I believe you could make etc. syntax test code code for context: |
I'm afraid I can't make heads or tails of these examples. |
Suppose your parsing some numbers
You get your range those strings are errors, that you may want to just clean up
you now have a range of Sumtype!(int,float); |
Ok, I see. It sounds like Personally, I don't think this function would be a good addition to the |
I think your viewing the goal wrong; you expand out the cases then you handle them, you may need to delay the logic for some reason in some ugly range function, then your cleaning up error states until you have the sumtypes you want. Tee is simple because its just disapearing the error state. For your type based syntax I think |
cough how open are you to pr's?
ranges+sumtypes need some work; I have some thoery and syntax test code, I think I can add a few functions to make your version better even if I dont care about all your safetyism goals
The text was updated successfully, but these errors were encountered: