                 } cond
             ] map concat <cord>
         ]
-    } cond ;
+    } cond ; inline


<PRIVATE

TUPLE: simple-cord first second ;

M: simple-cord length
    [ first>> length ] [ second>> length ] bi + ;

M: simple-cord virtual-seq first>> ;

M: simple-cord virtual@
    2dup first>> length <
    [ first>> ] [ [ first>> length - ] [ second>> ] bi ] if ;

TUPLE: multi-cord count seqs ;

M: multi-cord length count>> ;

M: multi-cord virtual@
    dupd
    seqs>> [ first <=> ] with search nip
    [ first - ] [ second ] bi ;

M: multi-cord virtual-seq
    seqs>> [ f ] [ first second ] if-empty ;

: <cord> ( seqs -- cord )
    dup length 2 = [
        first2 simple-cord boa
    ] [
        [ 0 [ length + ] accumulate ] keep zip multi-cord boa
    ] if ;

PRIVATE>


        { [ over cord? ] [ [ seqs>> values ] dip suffix <cord> ] }
        { [ dup cord? ] [ seqs>> values swap prefix <cord> ] }
        [ 2array <cord> ]
    } cond ; inline

: cord-concat ( seqs -- cord )
    {
