What are the semantics of A.p.f that you're trying to capture?
-
-
Replying to @wycats
class Array<T>{ filter(fn: typeof Boolean): Array<$NonNull<T>>; }
2 replies 0 retweets 0 likes -
that’s the type I added to the flow-core lib. Again, not saying this is some big reason for preferring Flow. just many small things
1 reply 0 retweets 0 likes -
After the non-nullable types and flow analysis. Typescript is pretty good. Just not quite Flow level yet.
2 replies 0 retweets 0 likes -
Replying to @wycats
hey. Got all the respect for you in the world. You probably know way more about type systems than I can imagine.
1 reply 0 retweets 0 likes -
Replying to @naman34
I'm very interested in the concrete thing you're trying to express. I'll be the first to admit deficiencies in TS.
1 reply 0 retweets 0 likes -
Replying to @wycats
maybe it's a little academic. All I'm trying to express is an overloaded type for the Array filter method.
1 reply 0 retweets 0 likes -
so while normally .filter will return the same array type as the input. If the function is the Boolean class it removes the nulla
2 replies 0 retweets 0 likes -
Replying to @naman34
here's what I would do in TS:pic.twitter.com/pwymUG3BZb
2 replies 0 retweets 1 like
whoops bug! I made it return T[] always. Fixing.
-
-
Replying to @wycats
this needed a new class (List) but at least it worked just fine. Looks like I need to play with TS 2.0 more.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.