« first day (1361 days earlier)      last day (417 days later) » 

 
4 hours later…
9:08 AM
This one works fine as a normal program here: Try it online!
but when I map it over a list, it just returns [] for some reason: Try it online!
@Zgarb is there any solution to it?
 
10:05 AM
@Razetime Hmm, I thought r was the problem, but changing it to i fixes it only partially: Try it online!
 
oh my god
 
Try it online! Ok there's definitely something fishy here.
 
yep it's very strange lol
well this works I guess Try it online!
 
Ok I see what's up
gets a string, which is a list of characters, and separates the elements by newlines
 
yes
 
10:12 AM
Then mi gets the int corresponding to each char of the resulting string
 
ok
so the zeros come from empty lists in the splits?
 
So "2,3" -> "'2'\n','\n'3'" -> bunch of 0s with 2 and 3
 
interesting
so r sees \n, freaks out and gives 0
for everything
is this behaviour put up somewhere in the wiki?
would be a good idea to put that there
or the tips thread
 
Yeah, that's probably what happens
I'm not sure if the behavior of r and i is fully documented. I should write that somewhere.
 
10:58 AM
Try it online! Question: How do Icenter each matrix's columns?
 
11:14 AM
What do you mean by center? Pad with 0s?
 
 
1 hour later…
12:35 PM
@Razetime It's because due to all the different types other functions can take, r knows it can return just about any concrete type at all; it defaults to TNum
@Zgarb Is that roughly correct?
 
12:56 PM
yes, pad with 0's
@Zgarb padding with 0's is it
I'm thinking something and then T0 probably
 
Hmm, might be easier to build the padding by hand and join
Not sure if optimal
 
mm cool
time goes fast eh
only two more days for LotM to end
 
1:58 PM
Man, I really hate ?, it takes forever to infer and it never does what you want it to
 
2:30 PM
well depends where you use it
It's pretty nice for recursive functions
@LegionMammal978 I recommend downloading ghci and running husk locally
 
@Razetime I do, still takes forever to infer though
After all, I could hardly have patched the string parsing without testing it offline
 
ah well
@Zgarb why use pairs when we can use two-element lists?
 
2:48 PM
@Razetime Two-element lists are really annoying, you can't even apply a function over them easily
It makes things like almost useless in practice
 
3:01 PM
well, applying a function over them, meaning?
you can use them as args?
 
Yeah, I asked about it earlier and it takes two bytes
(well, unless the result type is the same as the argument types, but that's rare in my experience)
 
gotta keep that in mind
 

« first day (1361 days earlier)      last day (417 days later) »