« first day (1464 days earlier)      last day (314 days later) » 

Leo
12:19 AM
@DominicvanEssen is a "deep map", it works the same as map except it can guess the right dimension in multidimensional lists by looking at the types
in your case you had a list like [[[1,2,3],[4,5,6]],[[7,6,5],[4,3,2]]]. You could convert the inner lists to numbers with mmd, or you could do the same with †d
Essentially, if can guess the types correctly it is equivalent to calling m an appropriate number of times
Then moving from moΠmd to mΠ†d you save one character because the second map is not nested in the first one anymore, but they are done in sequence. Instead of "For each sublist, convert each subsublist to a number and then take the product", you are doing "Convert each subsublist to a number, then for each sublist take the product"
 
 
2 hours later…
2:38 AM
@Leo yeah, just thought it'd make more sense to have 0 in it
 
Leo
2:51 AM
@Razetime We had some discussions on this, in the end we decided for consistency since everything else in Husk is 1-indexed
 
aaaa
ok
 
 
5 hours later…
7:24 AM
@Leo - Thanks a lot! Makes total sense now.
 
 
2 hours later…
8:56 AM
@Leo - I guess that the interpreter needs to use the rest of the program to infer what d means in this context, right? Just for fun I tried your example, and (on it's own) it doesn't do what we want... tio.run/##yygtzv7//1HDgpT///…
...it looks like goes one level too deep, and uses base10 instead of abas10 (so it's behaving like mmmd instead of mmd).
I suppose that only the mmd inference works correctly in the context of the rest of the program, because otherwise would make no sense on a list of lists. Did I get this all right?
 
 
1 hour later…
Leo
10:04 AM
@DominicvanEssen yep, you are 100% right!
well, actually you are 95% right: would still make sense (Π does cartesian product on lists), but when you try to find the index of the input in that list you know it has to be a list of numbers
 
Imagine if Type inference could read your mind
3
the world is not ready for that
 
 
9 hours later…
7:31 PM
@Razetime You would have to include your mind in the code since it impacts the parsing, putting it in the header would probably not be allowed. Probably better to ask on Meta, though. Inventing mind-reading is probably not worth it :)
 
 
3 hours later…
Leo
10:50 PM
@Razetime I don't think I can implement that myself, but probably Zgarb could
 

« first day (1464 days earlier)      last day (314 days later) »