guersam
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
TS generic seems like just another language 😅 The definition of
ReturnType
is interesting36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
ReturnType
works, thanks!36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
Oh yes,
["t"]
matters36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
I misunderstood. It emitted type error when I changed
<t>
with something else, but that was irrelevant. Arbitrary names work36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
And I just realized the exact name
t
matters36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
Thanks for the explanation. I'm still struggling and decided to stick to your first solution for now.
36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
I mean the latter.
36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
It must be fun to learn some TS generics at this chance, thanks!
At first I thought it should be
.infer
, but your recommendation sounds better as TS doesn't seem to have support for point free HKT.36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
Is there any change to put this trick into
Generic
's interface to match type(...).infer
?36 replies
Aarktype
•Created by guersam on 3/19/2025 in #questions
Inferring generic types
It's exactly what I want. Thank you very much!
36 replies