 : <spider-result> ( url depth -- spider-result )
     spider-result new
         swap >>depth
-        swap >>url ;
+        swap >>url ; inline
 
 <PRIVATE
 
 : apply-filters ( links spider -- links' )
-    filters>> [ '[ [ _ 1&& ] filter ] call( seq -- seq' ) ] when* ;
+    filters>> [
+        '[ [ _ 1&& ] filter ] call( seq -- seq' )
+    ] when* ;
 
 : push-links ( links level unique-deque -- )
     '[ _ _ push-url ] each ;

    [ base>> host>> ] [ links>> members ] bi*
    [ host>> = ] with partition ;

: add-spidered ( spider spider-result -- )
    [ [ 1 + ] change-count ] dip
    2dup [ spidered>> ] [ dup url>> ] bi* rot set-at
    [ filter-base-links ] 2keep
    depth>> 1 + swap
    [ add-nonmatching ]
    [ dup '[ _ apply-filters ] curry 2dip add-todo ] 2bi ;

: normalize-hrefs ( base links -- links' )
    [ derive-url ] with map ;


: run-spider ( spider -- spider )
    "spider" [
        queue-initial-links
        [ run-spider-loop ] keep
    ] with-logging ;
