Comments (6)
What about
data StdIOBehaviour r eff = ShareStream (Stream r eff) | [...]
and then specifying r
depending on the particular stream (stdin
etc.) and propagating eff
to the FFI definitions which use the options object?
from purescript-node-child-process.
I can't see how to make that work well, because different StdIOBehaviour
values corresponding to different streams all have to go into an array together, and often these different streams have different values for r
(in particular, stdin
, stdout
, and stderr
often appear there together); relevant docs: https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio
I'm not all that keen on propagating effect rows here either, because then you'd have to make sure they line up when you use spawn
and that might be a pain, but also if you're creating child processes the compiler isn't going to be able to tell you what effects that might cause, so I'm not sure effect tracking is going to pay off here.
from purescript-node-child-process.
On the array side, you could replace it with a record, since there are always three things in the array, right?
from purescript-node-child-process.
I don't think there necessarily are, at least node seems to happily spawn things if I specify stdio: []
or stdio: ['pipe']
. Although perhaps leaving them out is the same as passing null
, so I'd guess []
means the same as [null,null,null]
and ['pipe']
means the same as ['pipe',null,null]
. There are sometimes more than three things in the array, too.
from purescript-node-child-process.
Effect
simplifies this :)
from purescript-node-child-process.
This has been resolved in the new way of handling stdio
via the safe ChildProcess
and the unsafe UnsafeChildProcess
.
from purescript-node-child-process.
Related Issues (11)
- No license HOT 4
- exec should return ChildProcess
- (mk)onClose should fire on the "close" signal, not the "exit" signal
- The standard streams problem HOT 1
- Sync/Async HOT 2
- impossible to use ShareStream with purescript-node-process HOT 2
- Handle failed creation better HOT 3
- Add missing FFI: onSpawn handler
- Add Aff improved API HOT 7
- Can we use this with esbuild HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-node-child-process.