Closed JAForbes closed 6 years ago
Hello. I've just done a release with #41. Does the feature in that PR do what you want?
Wow π² that's great.
I still think it would be nice if every union exposed a predicate. But I'm happy with this new feature. π
-----Original Message----- From: "Simon Friis Vindum" notifications@github.com Sent: β8/β9/β2016 8:54 PM To: "paldepind/union-type" union-type@noreply.github.com Cc: "James Forbes" james.a.forbes@gmail.com; "Author" author@noreply.github.com Subject: Re: [paldepind/union-type] Support lists of types natively or via anexposed predicate. (#48)
Hello. I've just done a release with #41. Does the feature in that PR do what you want? β You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Is there a way to make a type checked collection?
Header.is
doesn't exist currently, but I'm imaging if a union had a predicate you could create things likeR.both( R.isArray, R.all(Header.is) )
to specify that field should be aHeader[]
.If there is a simpler approach as well, that would be great! π
I think it'd be nice to be able to specify a list of a given type as a built in behaviour as well.
E.g.
If we had access to the internal prototypes, we could use
R.is
, ora.isPrototypeOf(A)
, but I think the currying gets in the way of that.