The only problem I've had so far is that maybe() will have the flow type of the type it wraps, i.e. maybe(string) will have the flow type string and not ?string
I believe that this can be fixed by changing the definition of MaybeNode<V> so that it extends Node<?V> instead of Node<$NonMaybeType<V>>
+ export class MaybeNode<V> extends Node<?V> {
- export class MaybeNode<V> extends Node<$NonMaybeType<V>> {
First of all, this is a really cool use of Flow!
The only problem I've had so far is that
maybe()
will have the flow type of the type it wraps, i.e.maybe(string)
will have the flow typestring
and not?string
I believe that this can be fixed by changing the definition of
MaybeNode<V>
so that it extendsNode<?V>
instead ofNode<$NonMaybeType<V>>