-
Install
try-reflexto getnixwith all the dependencies: https://github.com/reflex-frp/reflex-platform/blob/develop/docs/project-development.rst(If mmorph can't be build on your system, you may need to use v0.6.2.0 , see this issue) (Also, see this issue if you get an error "cannot coerce null to a string")
-
Copy
Naproche-SADintofrontend/Naproche-SAD(or tell me how to get submodules to run without larger problems). -
Delete
frontend/Naproche-SAD/Naproche-SAD.cabal. (This needs to be done only if you encounter an error ".. .cabal was built with a newer hpack, please upgrade".) -
Delete in
frontend/Naproche-SAD/package.yamleverything after thelibrarydefinition. This is important, because otherwise the auto-generateddefault.nix(which we can't override) will demand theIsabellelibrary. TheIsabellelibrary depends onnetworkand can't be included here. -
cdinto this projects root directory and runnix-build -o frontend-result -A ghcjs.frontend. -
Delete the last line of
frontend-result/bin/frontend.jsexe/all.jsand add this code
var closure = "start";
onmessage = function(msg) {
if(closure === "start") {
closure = null;
h$main(h$mainZCZCMainzimain);
} else {
if(closure !== null) {
var cl = closure
closure = null;
cl(msg.data);
} else {
console.log("Unhandled by Naproche Worker: ");
console.log(msg.data);
}
}
};
var requestMessage = function(msg, c) {
postMessage(msg);
closure = c;
};
var writeMessage = function(msg, c) {
postMessage(msg);
};- Now you can include
all.jsas a webworker and communicate with it :) - Change, rebuilt by going to step 5 and open a PR :)