source Streams of those NodeJS streams - http://nodejs.org/api/stream.html Tasks with dependencies o r c h e s t r a t o r - https://www.npmjs.com/package/orchestrator (b a c h https://github.com/phated/bach) 11 / 46
h e a d - n 1 0 f i n d . - i n a m e ' * . j a r ' | x a r g s d u - k s | c u t - f 1 | x a r g s e c h o | s e d " s / / + / g " | b c t a r - c j / b a c k u p | c s t r e a m - t 7 7 7 k | s s h h o s t ' t a r - x j - C / b a c k u p ' p y t h o n - m j s o n . t o o l | p y g m e n t i z e - l j s b r e w o u t d a t e d | c u t - f 1 | x a r g s b r e w u p g r a d e 17 / 46
R e a d a b l e s t r e a m . W r i t a b l e s t r e a m . T r a n s f o r m s t r e a m . D u p l e x v a r R e a d a b l e = r e q u i r e ( ' s t r e a m ' ) . R e a d a b l e ; v a r r s = n e w R e a d a b l e ; r s . p u s h ( ' b e e p ' ) ; r s . p u s h ( ' b o o p \ n ' ) ; r s . p u s h ( n u l l ) ; r s . p i p e ( p r o c e s s . s t d o u t ) ; Streams over any type: Buffers, numbers, functions, objects Objects: add meta data 18 / 46
e = r e q u i r e ( ' v i n y l ' ) ; v a r c o f f e e F i l e = n e w F i l e ( { c w d : " / " , b a s e : " / t e s t / " , p a t h : " / t e s t / f i l e . c o f f e e " , c o n t e n t s : n e w B u f f e r ( " t e s t = 1 2 3 " ) } ) ; 19 / 46
r c g u l p . d e s t g u l p . w a t c h s r c : : G l o b - > S t r e a m V F S d e s t : : P a t h - > S t r e a m V F S - > S t r e a m V F S w a t c h : : G l o b - > S t r e a m V F S https://github.com/wearefractal/vinyl-fs 20 / 46
k ( n a m e , [ d e p s ] , f n ) g u l p . t a s k ( ' d e f a u l t ' , [ ' b u i l d ' ] , f u n c t i o n ( / * c b * / ) { r e t u r n / * s t r e a m | p r o m i s e | r x j s . . . * / } ) ; 22 / 46
( ' w a t c h ' , [ ' b u i l d ' ] , f u n c t i o n ( ) { g u l p . w a t c h ( ' s r c / j s / * * / * . j s ' , [ ' s c r i p t s ' ] ) ; g u l p . w a t c h ( ' s r c / c s s / * . s a s s ' , [ ' s t y l e ' ] ) ; } ) ; 23 / 46
s k ( ' c o p y ' , f u n c t i o n ( ) { r e t u r n g u l p . s r c ( ' s r c / * * / * . j s ' ) / / . p i p e ( . . . . ) / / . p i p e ( . . . . ) / / . p i p e ( . . . . ) . p i p e ( g u l p . d e s t ( ' d i s t / ' ) ) } ) ; 24 / 46
s k ( ' c o p y ' , f u n c t i o n ( ) { r e t u r n g u l p . s r c ( ' s r c / * * / * . j s ' ) . p i p e ( g u l p . d e s t ( ' d i s t / ' ) ) } ) ; Moar serious: g u l p . t a s k ( ' s c r i p t s ' , f u n c t i o n ( ) { r e t u r n g u l p . s r c ( ' s r c / * * / * . j s ' ) . p i p e ( $ . c o n c a t ( ' n a m e . j s ' ) ) . p i p e ( g u l p . d e s t ( ' d i s t / ' ) ) . p i p e ( $ . m i n i f y ( ) ) . p i p e ( $ . r e n a m e ( ' n a m e . m i n . j s ' ) ) . p i p e ( g u l p . d e s t ( ' d i s t / ' ) ) ; } ) ; 25 / 46
i r e ( ' g u l p - l o a d - p l u g i n s ' ) ; v a r Q = r e q u i r e ( ' k e w ' ) ; / / . . . . p i p e ( $ . m a p ( f u n c t i o n ( f i l e ) { r e t u r n Q . d e l a y ( 5 0 0 ) . t h e n ( f u n c t i o n ( ) { f i l e . t a g s = ( f i l e . t a g s | | [ ] ) . p u s h ( ' s l o w ' ) ; r e t u r n f i l e ; } ) ; } ) ) When you return undefined from your promise or regular function, the file is filtered from the stream. . p i p e ( $ . m a p ( f u n c t i o n ( f i l e ) { i f ( f i l e . p a t h . m a t c h ( / g u l p f i l e \ . j s / ) ) r e t u r n f i l e ; / / o t h e r f i l e s n o t e m i t t e d } ) ) 26 / 46
e q u i r e ( ' m a p - s t r e a m ' ) ; / / . . . . p i p e ( m a p ( f u n c t i o n ( f i l e , d o n e ) { d o n e ( n u l l , f i l e ) ; } ) ) 27 / 46
a number of interesting features, such as: Type Inference Higher Kinded Polymorphism Support for basic Javascript types Extensible records Extensible effects Optimizer rules for generation of efficient Javascript Pattern matching Simple FFI Modules Rank N Types Do Notation Tail-call elimination Type Classes 33 / 46
a number of interesting features, such as: 이며, 곡들의 컨 셉트에서부터 후반 작업에까지 관여한 의욕적인 품으로 총 10개 의 곡이 수록되어 었다. 흔히 “ 나카모리 아키 나 최대의 문제 작” 이라 부르 기도 하는데, 기획 단계 품으로 총 10개 의 곡이 수록되어 었다. 흔히 “ 나카모리 아키 34 / 46
8 0 3 JS A r r a y ( 1 1 8 0 3 ) . j o i n ( " * " ) Purescript f o l d l ( + + ) m e m p t y $ m a p ( c o n s t " * " ) $ r a n g e 0 1 1 8 0 2 36 / 46
o r t c o n c a t S t r i n g " " " f u n c t i o n c o n c a t S t r i n g ( s 1 ) { r e t u r n f u n c t i o n ( s 2 ) { r e t u r n s 1 + s 2 ; / / < ~ m e a t } ; } " " " : : S t r i n g - > S t r i n g - > S t r i n g Alternatively use e a s y - f f i f o o : : S t r i n g - > S t r i n g - > S t r i n g f o o = u n s a f e F o r e i g n F u n c t i o n [ " s 1 " , " s 2 " ] " s 1 + s 2 " 40 / 46
o r t c o n c a t S t r i n g " " " f u n c t i o n c o n c a t S t r i n g ( s 1 ) { r e t u r n f u n c t i o n ( s 2 ) { r e t u r n s 1 + s 2 ; } ; } " " " : : S t r i n g - > S t r i n g - > S t r i n g i n s t a n c e s e m i g r o u p S t r i n g : : S e m i g r o u p S t r i n g w h e r e ( < > ) = c o n c a t S t r i n g i n s t a n c e s e m i g r o u p A r r : : ( S e m i g r o u p s ' ) = > S e m i g r o u p ( s - > s ' ) w h e r e ( < > ) f g = \ x - > f x < > g x 41 / 46
: f o r a l l m . ( M o n o i d m ) = > m - > N u m b e r - > m then r e p e a t 0 _ = m e m p t y r e p e a t n x = x < > r e p e a t ( n - 1 ) x 44 / 46