-
Install
try-reflex
to getnix
with 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-SAD
intofrontend/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.yaml
everything after thelibrary
definition. This is important, because otherwise the auto-generateddefault.nix
(which we can't override) will demand theIsabelle
library. TheIsabelle
library depends onnetwork
and can't be included here. -
cd
into this projects root directory and runnix-build -o frontend-result -A ghcjs.frontend
. -
Delete the last line of
frontend-result/bin/frontend.jsexe/all.js
and 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.js
as a webworker and communicate with it :) - Change, rebuilt by going to step 5 and open a PR :)