Andrea Simone Costa
banner
jfet97.bsky.social
Andrea Simone Costa
@jfet97.bsky.social
Just some TypeScript here

https://andreasimonecosta.dev/posts/
it is suspiciously similar to THIS:

_ |_out_
0 | 0
1 | 1
December 26, 2024 at 10:17 PM
I saw that Andarist already answered. I just wanted to point out that article because there is no proper documentation when it comes to this topic
December 22, 2024 at 4:29 PM
I wrote an article about homomorphic mapped types. I did a deep dive in the compiler to understand them

andreasimonecosta.dev/posts/what-t...
What the heck is a homomorphic mapped type?
Let's try to understand what the TypeScript guys mean when they talk about homomorphic mapped types
andreasimonecosta.dev
December 22, 2024 at 4:15 PM
curiosity: what is the longest lookahead you are currently using in arktype?
December 20, 2024 at 10:30 AM
yeah that would have made me think I wasn't solving the challenge in the intended way 👀
December 18, 2024 at 9:16 AM
Now that you made me think about it probably I'm cheating because I'm directly using the Color type in their test as upperbound 😂
December 18, 2024 at 9:08 AM
I suspect you ahem didn't infer something
December 18, 2024 at 8:53 AM
I mean the following was enough so I don't get what you are referring to

<spoiler>
const createStreetLight = <X extends Color>(colors: X[], defaultColor: X) => {
console.log(colors);
return defaultColor;
}
</spoiler>
December 18, 2024 at 8:52 AM
Wait what did you do 😂 Which thing?
December 18, 2024 at 8:49 AM
But this is less type safe and I got too many type instantiation error here and there and I didn't bother too much
December 16, 2024 at 8:49 AM
@grad.dev @andarist.bsky.social

I think we could just gather all the types of the arguments till the last one to then signaling an error when the last parameter is passed if the history does not match with the order we want.

Not sure if that's what they had in mind.
December 16, 2024 at 8:49 AM
@andarist.bsky.social what do you think?
December 16, 2024 at 7:57 AM
Yeah I think t4 should fail as t5 and I'm not gonna waste time on that ahhahaah
December 16, 2024 at 7:56 AM
Yeah I remember I was tempted to write descriptions for some PRs of yours about reverse mapped types ahah

Another idea would be a six month vacation, I suspect the TS team will be more then happy to cover all the expenses for you and your family 😜😂
December 10, 2024 at 6:52 PM
That's just because I have only 3 PRs in total, I have to maximize the chances of being considere.

You 575 😅. You don't need anything else than "fixes #12345"
December 10, 2024 at 6:20 PM
Naming variables, git commit messages and PR titles are definitely not my strong suit 😆
December 10, 2024 at 5:43 PM
Thanks also to @andarist.bsky.social for making the switch case exhaustive!

PR: github.com/microsoft/Ty...

Playground: www.typescriptlang.org/play/?ts=5.8...
December 4, 2024 at 9:33 AM