 MIXIN: container
 INSTANCE: container collection
 
-: -container- ( quot -- quot' )
-    '[ cursor-value-unsafe @ ] ; inline
-
-: container- ( container quot -- begin end quot' )
-    all- -container- ; inline
-
-: each ( ... container quot: ( ... x -- ... ) -- ... ) container- -each ; inline
+: in- ( container quot -- begin end quot' )
+    all- -in- ; inline
+
+: each ( ... container quot: ( ... x -- ... ) -- ... ) in- -each ; inline
 
 INSTANCE: finite-stream-cursor container
 

M: sequence-cursor set-cursor-value [ n>> ] [ seq>> ] bi set-nth ; inline

!
! pipe cursor
!

TUPLE: pipe-cursor
    { from read-only }
    { to read-only } ;
C: <pipe-cursor> pipe-cursor

INSTANCE: pipe-cursor forward-cursor

M: pipe-cursor cursor-compatible? [ from>> ] bi@ cursor-compatible? ; inline
M: pipe-cursor cursor-valid? [ from>> ] [ to>> ] bi [ cursor-valid? ] both? ; inline
M: pipe-cursor cursor= [ from>> ] bi@ cursor= ; inline
M: pipe-cursor inc-cursor [ from>> inc-cursor ] [ to>> inc-cursor ] bi <pipe-cursor> ; inline

INSTANCE: pipe-cursor output-cursor

M: pipe-cursor set-cursor-value-unsafe to>> set-cursor-value-unsafe ; inline
M: pipe-cursor set-cursor-value        to>> set-cursor-value        ; inline

: -pipe- ( begin end quot to -- begin' end' quot' )
    swap [ '[ _ <pipe-cursor> ] bi@ ] dip '[ from>> @ ] ; inline

!
! pusher cursor

: 2all- ( a b quot -- begin end quot )
    [ 2all ] dip ; inline

ALIAS: -2in- -assoc-

: 2in- ( a b quot -- begin end quot' )
    2all- -2in- ; inline

: 2each ( ... a b quot: ( ... x y -- ... ) -- ... )
    2in- -each ; inline

: 2map-as ( ... a b quot: ( ... x y -- ... z ) exemplar -- ... c )
    [ 2in- ] dip -map-as ; inline

: 2map ( ... a b quot: ( ... x y -- ... z ) -- ... c )
    pick 2map-as ; inline 
