You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ambrose Bonnaire-Sergeant edited this page Nov 15, 2015
·
5 revisions
Limitations
Using filter
Not everything can be inferred from a filter. A common example is
(filter identity coll) does not work. The reason is identity only
gives negative information when its result is true: that the argument is not(U nil false).
This idiom must be converted to this syntax (fn [a] a) and then annotated with
positive propositions.
Positive information infers just fine, like (filter number? coll).
The above idiom is useful when you are filtering something like a (Seqable (U nil x)) and there is no
predicate to test for x, so you can only test if something isn't nil.