1 USING: fry functors generalizations kernel macros sequences
2 sequences.generalizations ;
3 IN: models.combinators.templates
4 FROM: models.combinators => <collection> #1 ;
5 <FUNCTOR: fmaps ( W -- )
16 MACRO: w-n ( int -- quot )
17 dup '[ [ _ narray <collection> ] dip [ _ firstn ] prepend W ] ;
18 : w-2 ( a b quot -- mapped ) 2 w-n ; inline
19 : w-3 ( a b c quot -- mapped ) 3 w-n ; inline
20 : w-4 ( a b c d quot -- mapped ) 4 w-n ; inline
21 MACRO: w-n* ( int -- quot )
22 dup '[ [ _ narray <collection> #1 ] dip [ _ firstn ] prepend W ] ;
23 : w-2* ( a b quot -- mapped ) 2 w-n* ; inline
24 : w-3* ( a b c quot -- mapped ) 3 w-n* ; inline
25 : w-4* ( a b c d quot -- mapped ) 4 w-n* ; inline