« first day (4940 days earlier)   
07:00 - 09:0010:00 - 14:00

7:14 AM
Is it possible to make a generic type that appends a type to a tuple?
Input = tuple[int, str]
Output = Append[Input, bool]  # Output should be tuple[int, str, bool]
I'm gonna go ahead and say "probably not" because so far that has always ended with Miyagi proving me wrong
I'm manipulating fate
 
7:52 AM
Have you tried typing.Unpack?
 
And there it is! I only tried Concatenate :/
I devised an alternative implementation in the meantime, so now I have to decide which one I wanna go with
The quail of the whale
(German inside joke, don't worry about it)
 
(cringes in German)
@Aran-Fey Now I'm interested in just how you did that. ^^
 
Proving once again that germans have no sense of humor :/
(Whether that's me or Miyagi is up for interpretation)
@MisterMiyagi The idea was to represent units as a tuple. For example, acceleration would be Unit[Distance, Invert[Time], Invert[Time]]. But typing out the whole thing every time was annoying, so I wanted something like Divide[Speed, Time] to give the same output
The alternative is to represent that as a bunch of nested Mul and Div types, i.e. Acceleration = Div[Div[Distance, Time], Time]
 
8:38 AM
@Aran-Fey Ooooh, that sounds like fun if you want to support conversions between equivalent units.
 
I don't think that's going to be possible. Unit[A, B] and Unit[B, A] will be treated as distinct types, and we're just gonna have to live with that
 
Union supports that, but it's probably special-cased.
 
The problem with Union is that it doesn't allow duplicates, so it can't express Area = Mul[Distance, Distance]
 
True. You'll probably run into some further issues along the line anyways if you go down that rabbit hole.
 
07:00 - 09:0010:00 - 14:00

« first day (4940 days earlier)