     [ count-callables ] map-words sum ;
 
 M: word count-callables
-    def>> [ callable? ] deep-filter length ;
+    def>> 0 [ callable? [ 1 + ] when ] deep-reduce ;
 
 PRIVATE>
 

    ".private" ?tail drop ".private" append ;

: coverage-words ( string -- words )
    vocab-words [ { [ primitive? not ] [ symbol? not ] [ predicate? not ] } 1&& ] filter ;

PRIVATE>


USING: accessors arrays assocs classes combinators.short-circuit
continuations fry io kernel math namespaces prettyprint
quotations sequences sequences.deep splitting strings
tools.annotations tools.test.private vocabs words words.symbol ;
IN: tools.coverage

TUPLE: coverage-state < identity-tuple executed? ;
