diff --git a/README.md b/README.md index c7819f88..5abdef83 100644 --- a/README.md +++ b/README.md @@ -519,9 +519,42 @@ Contributions are very welcome! When modifying the compiler, run `make newmhs` or `make newmhsz` (the latter compresses the binary) to generate a compiler that includes your changes. -## Libraries +## Third-party packages + +Adding MicroHs support to a third-party package may take some initial effort, either by modifying the package itself, or by extending MicroHs. + +- For conditional compilation you can test for `__MHS__` via CPP. + +Once a package compiles with MicroHs, make sure it stays that way by adding a GitHub Action to the project repository: + +```yaml +# file .github/workflows/mhs.yml + +name: MicroHs + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Install MicroHs + uses: augustss/MicroHs@nightly + + - name: Clone project repository + uses: actions/checkout@v4 + + - name: Build project + run: mcabal -r build +``` + +## Bundled libraries -The libraries live in the `lib/` directory. Adding missing functions/instances/types from the report is a welcome contribution. +The bundled libraries live in the `lib/` directory. Adding missing functions/instances/types from the report is a welcome contribution. Common things from `base` and GHC boot libraries that use a lot of GHC-specific code (such as `array`, `bytestring`, `text`, ...) can also be added. ## Tests @@ -606,6 +639,6 @@ gay@disroot.org * Q: Why are the error messages so bad? * A: Error messages are boring. * - * Q: Why is the so much source code? + * Q: Why is there so much source code? * A: I wonder this myself. 10000+ lines of Haskell seems excessive. 6000+ lines of C is also more than I'd like for such a simple system. diff --git a/action.yml b/action.yml new file mode 100644 index 00000000..c23d7ad1 --- /dev/null +++ b/action.yml @@ -0,0 +1,15 @@ +name: Setup MicroHs +description: Install `mhs`, `mcabal`, `cpphs`, and basic libraries to `$HOME/.mcabal` + +branding: + icon: cpu + color: white + +runs: + using: composite + steps: + - shell: bash + name: Install MicroHs + run: | + curl -sSL https://github.com/sol/MicroHs/releases/download/nightly/MicroHs-linux-x86_64.tar.gz | tar -xz -C "$HOME" + echo "$HOME/.mcabal/bin" >> "$GITHUB_PATH"