Call JavaScript from Haskell, and vice versa!
See the codeinline-js: Call JavaScript from Haskell, and vice versa!Haddock documentation for HEAD is available.
inline-js as a dependencycabalAdd a source-repository-package in the cabal.project file, see
documentation
for details.
stackAdd an extra-deps entry in the stack.yaml file, see
documentation
for details.
nixHere's an example overlay.
pkgsSelf: pkgsSuper:
let
src = pkgsSelf.fetchFromGitHub {
owner = "tweag";
repo = "inline-js";
rev = "<rev>";
sha256 = pkgsSelf.lib.fakeSha256;
};
in
{
haskellPackages = pkgsSuper.haskellPackages.override {
overrides = self: _: {
inline-js-core = (self.callCabal2nixWithOptions "inline-js-core" src
"--subpath inline-js-core"
{ }).overrideAttrs (_: {
preBuild = ''
substituteInPlace src/Language/JavaScript/Inline/Core/NodePath.hs --replace '"node"' '"${pkgsSelf.nodejs-16_x}/bin/node"'
'';
});
inline-js =
self.callCabal2nixWithOptions "inline-js" src "--subpath inline-js" { };
};
};
}
haskell.nixSee documentation for details.
node sessions which run the eval server script for Haskell/JavaScript
interoprequire()/import() supportnode_modulesJSVal references in HaskellPromise-based async evaluationaeson supportnode native addon or third party libraries.d.ts codeplaywright/puppeteer for running JavaScript in browsersSupported GHC versions:
ghc-8.6, tested with ghc-8.6.5ghc-8.8, tested with ghc-8.8.4ghc-8.10, tested with ghc-8.10.7ghc-9.0, tested with ghc-9.0.1Supported platforms:
Supported node versions:
node-v10, minimum v10.20.0node-v12 and laterSee the CI config for details.
inline-js is maintained by Tweag I/O.
Have questions? Need help? Tweet at @tweagio.
32 commits
Haskell
66.2%
JavaScript
20.4%
Nix
13.4%
Call JavaScript from Haskell, and vice versa!
See the codeinline-js: Call JavaScript from Haskell, and vice versa!Haddock documentation for HEAD is available.
inline-js as a dependencycabalAdd a source-repository-package in the cabal.project file, see
documentation
for details.
stackAdd an extra-deps entry in the stack.yaml file, see
documentation
for details.
nixHere's an example overlay.
pkgsSelf: pkgsSuper:
let
src = pkgsSelf.fetchFromGitHub {
owner = "tweag";
repo = "inline-js";
rev = "<rev>";
sha256 = pkgsSelf.lib.fakeSha256;
};
in
{
haskellPackages = pkgsSuper.haskellPackages.override {
overrides = self: _: {
inline-js-core = (self.callCabal2nixWithOptions "inline-js-core" src
"--subpath inline-js-core"
{ }).overrideAttrs (_: {
preBuild = ''
substituteInPlace src/Language/JavaScript/Inline/Core/NodePath.hs --replace '"node"' '"${pkgsSelf.nodejs-16_x}/bin/node"'
'';
});
inline-js =
self.callCabal2nixWithOptions "inline-js" src "--subpath inline-js" { };
};
};
}
haskell.nixSee documentation for details.
node sessions which run the eval server script for Haskell/JavaScript
interoprequire()/import() supportnode_modulesJSVal references in HaskellPromise-based async evaluationaeson supportnode native addon or third party libraries.d.ts codeplaywright/puppeteer for running JavaScript in browsersSupported GHC versions:
ghc-8.6, tested with ghc-8.6.5ghc-8.8, tested with ghc-8.8.4ghc-8.10, tested with ghc-8.10.7ghc-9.0, tested with ghc-9.0.1Supported platforms:
Supported node versions:
node-v10, minimum v10.20.0node-v12 and laterSee the CI config for details.
inline-js is maintained by Tweag I/O.
Have questions? Need help? Tweet at @tweagio.
32 commits
Haskell
66.2%
JavaScript
20.4%
Nix
13.4%