Tag: monad

Node.jsstream对象模式

我试图理解对象stream的概念,尤其是两者的结合。 我正在寻找的用法是pipe道字节stream连同对象stream如: // StringifyStream reads Buffers and emits String Objects // Mapper is really just a classical map // BytifyStream reads String Objects and emits buffers. process.stdin.pipe( StringifyStream() ).pipe( Mapper(function(s) { return s.toUpperCase(); }).pipe( BytifyStream() ).pipe(process.stdout); // This code should read from stdin, convert all incoming buffers to strings, // map those strings to upper […]