Pipe generic types
I'm trying to extract a generic type, but it seems like it's not possible, or am I mistaken?
What I'm trying to do is to extract a generic property
But pipe does not exist on Generic
6 Replies
This would be the way to define it syntactically, though if you want the inference to work here for specific types you will likely need to use an HKT or an external generic wrapper:
Awesome, thanks! I suppose I could also add another => t after the jsonValue extraction? However that would introduce redundant validation logic
What is this syntax called / where can I find it in the docs? Ctrl + K is not getting any hits
Should be doable one of those other ways if you need the narrowed inference
for any expression it is called the
tuple
syntax, you can see it by clicking that tab
It's primarily useful because it allows you to write arbitrary expressions like this with pure syntax in contexts like a scope or generic where you can't directly introduce a type
wrapper
At some point I will do a more general intro on different syntax types and when to use them since I know that can be a bit confusingHm I can't find a tuple tab, only tuple types, not tuple syntax
No I mean it's embedded in each expression as an option:

Ah I see, thanks