tweag / inline-js

Call JavaScript from Haskell, and vice versa!
https://inline-js.netlify.app
131 stars 10 forks source link

inline-js: Call JavaScript from Haskell, and vice versa!

GitHub Actions Gitter Netlify Status

Documentation

Haddock

Haddock documentation for HEAD is available.

Adding inline-js as a dependency

cabal

Add a source-repository-package in the cabal.project file, see documentation for details.

stack

Add an extra-deps entry in the stack.yaml file, see documentation for details.

nix

Here'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.nix

See documentation for details.

Implemented features

Planned features

Supported versions

Supported GHC versions:

Supported platforms:

Supported node versions:

See the CI config for details.

Contributors

inline-js is maintained by Tweag I/O.

Have questions? Need help? Tweet at @tweagio.