Skip to content

Commit 36ec952

Browse files
Improve .ghc.environment (#59)
This pull request intends to make it easier to create a working `.ghc.environment` file. * The HyperHaskell app now accepts a local installation of `hyper-haskell-server` * Building the package `docs/ghc-env/ghc-env.cabal` should create a suitable `.ghc.environment` file
2 parents 6b9a464 + 66eb14b commit 36ec952

File tree

10 files changed

+49
-3
lines changed

10 files changed

+49
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
### HyperHaskell app bundle
55

6+
**v2.4.2** — Snapshot release.
7+
8+
* When using `cabal`, allow local compilation of `hyper-haskell-server`.
9+
610
**v2.4.1** — Snapshot release.
711

812
* Fix "Insert Evaluation Cell Above"yp menu item.
913
* Fix "Open…" and "Save As…" dialogs.
10-
* Look for `ghc` in both `~/.local/bin` and `~/.cabal/bin` when using `cabal`.
14+
* Look for `hyper-haskell-server` in both `~/.local/bin` and `~/.cabal/bin` when using `cabal`.
1115

1216
**v2.4.0** — Snapshot release.
1317

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "HyperHaskell",
3-
"version": "2.4.1",
3+
"version": "2.4.2",
44
"main": "src/main.js",
55
"devDependencies": {
66
"electron": "^38.2.2"

app/src/interpreter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ exports.init = () => {
9999
} else {
100100
cmd = cmdNew
101101
}
102+
if (packagePath) {
103+
cmd = cwd + '/' + packagePath + '/hyper-haskell-server'
104+
}
102105
}
103106
} else if (packageTool == 'cabal.project') {
104107
cmd = 'cabal'

docs/ghc-env/Main.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Main where
2+
3+
main :: IO ()
4+
main = putStrLn "Hello, Haskell!"

docs/ghc-env/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
This directory contains a dummy `.cabal` file for creating a `.ghc.environment` file with a consistent set of packages.
2+
3+
To create a `.ghc.environment` file in this directory, run
4+
5+
```
6+
./mk-ghc-env.sh
7+
```
8+
9+
Put your worksheet into this directory as well, and enter `.` in the "cabal — .ghc.environment" settings
10+
11+
![](settings-back-end-cabal.png)

docs/ghc-env/cabal.project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages: .
2+
write-ghc-environment-files: always

docs/ghc-env/ghc-env.cabal

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cabal-version: 3.0
2+
name: ghc-env
3+
synopsis: Dummy .cabal file to generate a consistent set of packages.
4+
version: 0.1.0.0
5+
build-type: Simple
6+
7+
executable package-db-dummy
8+
main-is: Main.hs
9+
build-depends:
10+
, base
11+
, Chart
12+
, Chart-diagrams
13+
, deltaq >=1.1 && <1.2
14+
, diagrams-lib
15+
, diagrams-svg
16+
, hyper
17+
, hyper-extra
18+
19+
build-tool-depends: hyper-haskell-server:hyper-haskell-server
20+
hs-source-dirs: .

docs/ghc-env/mk-ghc-env.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
cabal build && cabal install hyper-haskell-server --installdir=.
6.15 KB
Loading

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ELECTRON := "electron"
22

3-
VERSION := "0.2.4.1"
3+
VERSION := "0.2.4.2"
44

55
######################################################################
66
# Development targets

0 commit comments

Comments
 (0)