on master help sign in
Got PS Working
688b4b6iko
.gitignore+4
@@ -4,3 +4,7 @@ static/elm.js
4dist-newstyle
4dist-newstyle
5result
5result
6static/backend.js
6static/backend.js
7+.spago
8+output
9+.psc-ide-port
10+backend.js
backend/.vscode/settings.jsondeleted−5
@@ -1,5 +0,0 @@
1−{
2− "nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix",
3− "haskell.serverExecutablePath": "haskell-language-server",
4− "editor.formatOnSave": true
5−}
backend/FFI.jsnew file+5
@@ -0,0 +1,5 @@
1+export function startElm(element) {
2+ Elm.Main.init({
3+ node: document.getElementById(element)
4+ })
5+}
backend/FFI.pursnew file+10
@@ -0,0 +1,10 @@
1+module FFI
2+ ( startElm
3+ )
4+ where
5+
6+import Prelude
7+
8+import Effect (Effect)
9+
10+foreign import startElm :: String -> Effect Unit
backend/Main.pursnew file+13
@@ -0,0 +1,13 @@
1+module Main where
2+
3+import Prelude
4+
5+import Effect (Effect)
6+import Effect.Console (log)
7+import FFI as FFI
8+
9+
10+main :: Effect Unit
11+main = do
12+ FFI.startElm "elm"
13+ log "🍝"
backend/backend.cabaldeleted−69
@@ -1,69 +0,0 @@
1−cabal-version: 2.4
2−name: backend
3−version: 0.1.0.0
4−author: iko
5−maintainer: ilyakooo0@gmail.com
6−extra-source-files: CHANGELOG.md
7−
8−executable backend
9− ghcjs-options: -dedupe
10− ghcjs-options: -DGHCJS_BUSY_YIELD=20 -DGHCJS_GC_INTERVAL=60000
11− main-is: Main.hs
12− other-modules: FFI
13− build-depends:
14− , aeson <2.0.0.0
15− , base
16− , bytestring
17− , containers
18− , ghcjs-base-stub ==0.3.0.1
19− , relude
20− , text
21− , time
22−
23− hs-source-dirs: src
24− default-language: Haskell2010
25− ghc-options:
26− -Weverything -Wno-implicit-prelude -Wno-missing-safe-haskell-mode
27− -Wno-safe -Wno-prepositive-qualified-module
28− -Wno-missing-import-lists -Wno-all-missed-specialisations
29− -Wno-missing-local-signatures -Wno-partial-fields -Wno-unsafe
30− -Wno-monomorphism-restriction -Wno-missed-specialisations
31− -Wno-unused-packages -Wno-partial-type-signatures
32− -Wno-unticked-promoted-constructors -threaded
33−
34− default-extensions:
35− AllowAmbiguousTypes
36− ApplicativeDo
37− BlockArguments
38− ConstraintKinds
39− DataKinds
40− DefaultSignatures
41− DeriveAnyClass
42− DeriveFunctor
43− DeriveGeneric
44− DerivingVia
45− DuplicateRecordFields
46− FlexibleContexts
47− FlexibleInstances
48− FunctionalDependencies
49− GADTs
50− GeneralizedNewtypeDeriving
51− LambdaCase
52− MonoLocalBinds
53− MultiParamTypeClasses
54− OverloadedLabels
55− OverloadedStrings
56− PartialTypeSignatures
57− PolyKinds
58− RankNTypes
59− RecordWildCards
60− RecursiveDo
61− ScopedTypeVariables
62− StandaloneDeriving
63− StandaloneKindSignatures
64− TupleSections
65− TypeApplications
66− TypeFamilies
67− TypeOperators
68− UndecidableInstances
69− ViewPatterns
backend/flake.lockdeleted−453
@@ -1,453 +0,0 @@
1−{
2− "nodes": {
3− "HTTP": {
4− "flake": false,
5− "locked": {
6− "lastModified": 1451647621,
7− "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=",
8− "owner": "phadej",
9− "repo": "HTTP",
10− "rev": "9bc0996d412fef1787449d841277ef663ad9a915",
11− "type": "github"
12− },
13− "original": {
14− "owner": "phadej",
15− "repo": "HTTP",
16− "type": "github"
17− }
18− },
19− "cabal-32": {
20− "flake": false,
21− "locked": {
22− "lastModified": 1603716527,
23− "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=",
24− "owner": "haskell",
25− "repo": "cabal",
26− "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee",
27− "type": "github"
28− },
29− "original": {
30− "owner": "haskell",
31− "ref": "3.2",
32− "repo": "cabal",
33− "type": "github"
34− }
35− },
36− "cabal-34": {
37− "flake": false,
38− "locked": {
39− "lastModified": 1640353650,
40− "narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=",
41− "owner": "haskell",
42− "repo": "cabal",
43− "rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd",
44− "type": "github"
45− },
46− "original": {
47− "owner": "haskell",
48− "ref": "3.4",
49− "repo": "cabal",
50− "type": "github"
51− }
52− },
53− "cabal-36": {
54− "flake": false,
55− "locked": {
56− "lastModified": 1641652457,
57− "narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=",
58− "owner": "haskell",
59− "repo": "cabal",
60− "rev": "f27667f8ec360c475027dcaee0138c937477b070",
61− "type": "github"
62− },
63− "original": {
64− "owner": "haskell",
65− "ref": "3.6",
66− "repo": "cabal",
67− "type": "github"
68− }
69− },
70− "cardano-shell": {
71− "flake": false,
72− "locked": {
73− "lastModified": 1608537748,
74− "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=",
75− "owner": "input-output-hk",
76− "repo": "cardano-shell",
77− "rev": "9392c75087cb9a3d453998f4230930dea3a95725",
78− "type": "github"
79− },
80− "original": {
81− "owner": "input-output-hk",
82− "repo": "cardano-shell",
83− "type": "github"
84− }
85− },
86− "flake-compat": {
87− "flake": false,
88− "locked": {
89− "lastModified": 1650374568,
90− "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
91− "owner": "edolstra",
92− "repo": "flake-compat",
93− "rev": "b4a34015c698c7793d592d66adbab377907a2be8",
94− "type": "github"
95− },
96− "original": {
97− "owner": "edolstra",
98− "repo": "flake-compat",
99− "type": "github"
100− }
101− },
102− "flake-utils": {
103− "locked": {
104− "lastModified": 1656928814,
105− "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
106− "owner": "numtide",
107− "repo": "flake-utils",
108− "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
109− "type": "github"
110− },
111− "original": {
112− "owner": "numtide",
113− "repo": "flake-utils",
114− "type": "github"
115− }
116− },
117− "flake-utils_2": {
118− "locked": {
119− "lastModified": 1644229661,
120− "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
121− "owner": "numtide",
122− "repo": "flake-utils",
123− "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
124− "type": "github"
125− },
126− "original": {
127− "owner": "numtide",
128− "repo": "flake-utils",
129− "type": "github"
130− }
131− },
132− "ghc-8.6.5-iohk": {
133− "flake": false,
134− "locked": {
135− "lastModified": 1600920045,
136− "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=",
137− "owner": "input-output-hk",
138− "repo": "ghc",
139− "rev": "95713a6ecce4551240da7c96b6176f980af75cae",
140− "type": "github"
141− },
142− "original": {
143− "owner": "input-output-hk",
144− "ref": "release/8.6.5-iohk",
145− "repo": "ghc",
146− "type": "github"
147− }
148− },
149− "hackage": {
150− "flake": false,
151− "locked": {
152− "lastModified": 1658195491,
153− "narHash": "sha256-PFpjvu2WnOq3qWRZcFtf72Zrx8ZEaDUpGSGX6TnOcmA=",
154− "owner": "input-output-hk",
155− "repo": "hackage.nix",
156− "rev": "50330b825035bf45d680e7fa14810a18c811603c",
157− "type": "github"
158− },
159− "original": {
160− "owner": "input-output-hk",
161− "repo": "hackage.nix",
162− "type": "github"
163− }
164− },
165− "haskellNix": {
166− "inputs": {
167− "HTTP": "HTTP",
168− "cabal-32": "cabal-32",
169− "cabal-34": "cabal-34",
170− "cabal-36": "cabal-36",
171− "cardano-shell": "cardano-shell",
172− "flake-utils": "flake-utils_2",
173− "ghc-8.6.5-iohk": "ghc-8.6.5-iohk",
174− "hackage": "hackage",
175− "hpc-coveralls": "hpc-coveralls",
176− "hydra": "hydra",
177− "nix-tools": "nix-tools",
178− "nixpkgs": [
179− "haskellNix",
180− "nixpkgs-unstable"
181− ],
182− "nixpkgs-2003": "nixpkgs-2003",
183− "nixpkgs-2105": "nixpkgs-2105",
184− "nixpkgs-2111": "nixpkgs-2111",
185− "nixpkgs-2205": "nixpkgs-2205",
186− "nixpkgs-unstable": "nixpkgs-unstable",
187− "old-ghc-nix": "old-ghc-nix",
188− "stackage": "stackage"
189− },
190− "locked": {
191− "lastModified": 1658216441,
192− "narHash": "sha256-eWsrJFBZ4fMC/UN7c09GNXVfVIrJzW9RvfdD0RfaisU=",
193− "owner": "input-output-hk",
194− "repo": "haskell.nix",
195− "rev": "0dca71e2f3f3d63eeab01136138e0e1ceab5320d",
196− "type": "github"
197− },
198− "original": {
199− "owner": "input-output-hk",
200− "repo": "haskell.nix",
201− "type": "github"
202− }
203− },
204− "hpc-coveralls": {
205− "flake": false,
206− "locked": {
207− "lastModified": 1607498076,
208− "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=",
209− "owner": "sevanspowell",
210− "repo": "hpc-coveralls",
211− "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430",
212− "type": "github"
213− },
214− "original": {
215− "owner": "sevanspowell",
216− "repo": "hpc-coveralls",
217− "type": "github"
218− }
219− },
220− "hydra": {
221− "inputs": {
222− "nix": "nix",
223− "nixpkgs": [
224− "haskellNix",
225− "hydra",
226− "nix",
227− "nixpkgs"
228− ]
229− },
230− "locked": {
231− "lastModified": 1646878427,
232− "narHash": "sha256-KtbrofMtN8GlM7D+n90kixr7QpSlVmdN+vK5CA/aRzc=",
233− "owner": "NixOS",
234− "repo": "hydra",
235− "rev": "28b682b85b7efc5cf7974065792a1f22203a5927",
236− "type": "github"
237− },
238− "original": {
239− "id": "hydra",
240− "type": "indirect"
241− }
242− },
243− "lowdown-src": {
244− "flake": false,
245− "locked": {
246− "lastModified": 1633514407,
247− "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=",
248− "owner": "kristapsdz",
249− "repo": "lowdown",
250− "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8",
251− "type": "github"
252− },
253− "original": {
254− "owner": "kristapsdz",
255− "repo": "lowdown",
256− "type": "github"
257− }
258− },
259− "nix": {
260− "inputs": {
261− "lowdown-src": "lowdown-src",
262− "nixpkgs": "nixpkgs",
263− "nixpkgs-regression": "nixpkgs-regression"
264− },
265− "locked": {
266− "lastModified": 1643066034,
267− "narHash": "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg=",
268− "owner": "NixOS",
269− "repo": "nix",
270− "rev": "a1cd7e58606a41fcf62bf8637804cf8306f17f62",
271− "type": "github"
272− },
273− "original": {
274− "owner": "NixOS",
275− "ref": "2.6.0",
276− "repo": "nix",
277− "type": "github"
278− }
279− },
280− "nix-tools": {
281− "flake": false,
282− "locked": {
283− "lastModified": 1649424170,
284− "narHash": "sha256-XgKXWispvv5RCvZzPb+p7e6Hy3LMuRjafKMl7kXzxGw=",
285− "owner": "input-output-hk",
286− "repo": "nix-tools",
287− "rev": "e109c94016e3b6e0db7ed413c793e2d4bdb24aa7",
288− "type": "github"
289− },
290− "original": {
291− "owner": "input-output-hk",
292− "repo": "nix-tools",
293− "type": "github"
294− }
295− },
296− "nixpkgs": {
297− "locked": {
298− "lastModified": 1632864508,
299− "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=",
300− "owner": "NixOS",
301− "repo": "nixpkgs",
302− "rev": "82891b5e2c2359d7e58d08849e4c89511ab94234",
303− "type": "github"
304− },
305− "original": {
306− "id": "nixpkgs",
307− "ref": "nixos-21.05-small",
308− "type": "indirect"
309− }
310− },
311− "nixpkgs-2003": {
312− "locked": {
313− "lastModified": 1620055814,
314− "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=",
315− "owner": "NixOS",
316− "repo": "nixpkgs",
317− "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205",
318− "type": "github"
319− },
320− "original": {
321− "owner": "NixOS",
322− "ref": "nixpkgs-20.03-darwin",
323− "repo": "nixpkgs",
324− "type": "github"
325− }
326− },
327− "nixpkgs-2105": {
328− "locked": {
329− "lastModified": 1655034179,
330− "narHash": "sha256-rf1/7AbzuYDw6+8Xvvf3PtEOygymLBrFsFxvext5ZjI=",
331− "owner": "NixOS",
332− "repo": "nixpkgs",
333− "rev": "046ee4af7a9f016a364f8f78eeaa356ba524ac31",
334− "type": "github"
335− },
336− "original": {
337− "owner": "NixOS",
338− "ref": "nixpkgs-21.05-darwin",
339− "repo": "nixpkgs",
340− "type": "github"
341− }
342− },
343− "nixpkgs-2111": {
344− "locked": {
345− "lastModified": 1656782578,
346− "narHash": "sha256-1eMCBEqJplPotTo/SZ/t5HU6Sf2I8qKlZi9MX7jv9fw=",
347− "owner": "NixOS",
348− "repo": "nixpkgs",
349− "rev": "573603b7fdb9feb0eb8efc16ee18a015c667ab1b",
350− "type": "github"
351− },
352− "original": {
353− "owner": "NixOS",
354− "ref": "nixpkgs-21.11-darwin",
355− "repo": "nixpkgs",
356− "type": "github"
357− }
358− },
359− "nixpkgs-2205": {
360− "locked": {
361− "lastModified": 1657876628,
362− "narHash": "sha256-URmf0O2cQ/3heg2DJOeLyU/JmfVMqG4X5t9crQXMaeY=",
363− "owner": "NixOS",
364− "repo": "nixpkgs",
365− "rev": "549d82bdd40f760a438c3c3497c1c61160f3de55",
366− "type": "github"
367− },
368− "original": {
369− "owner": "NixOS",
370− "ref": "nixpkgs-22.05-darwin",
371− "repo": "nixpkgs",
372− "type": "github"
373− }
374− },
375− "nixpkgs-regression": {
376− "locked": {
377− "lastModified": 1643052045,
378− "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
379− "owner": "NixOS",
380− "repo": "nixpkgs",
381− "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
382− "type": "github"
383− },
384− "original": {
385− "id": "nixpkgs",
386− "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
387− "type": "indirect"
388− }
389− },
390− "nixpkgs-unstable": {
391− "locked": {
392− "lastModified": 1657888067,
393− "narHash": "sha256-GnwJoFBTPfW3+mz7QEeJEEQ9OMHZOiIJ/qDhZxrlKh8=",
394− "owner": "NixOS",
395− "repo": "nixpkgs",
396− "rev": "65fae659e31098ca4ac825a6fef26d890aaf3f4e",
397− "type": "github"
398− },
399− "original": {
400− "owner": "NixOS",
401− "ref": "nixpkgs-unstable",
402− "repo": "nixpkgs",
403− "type": "github"
404− }
405− },
406− "old-ghc-nix": {
407− "flake": false,
408− "locked": {
409− "lastModified": 1631092763,
410− "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=",
411− "owner": "angerman",
412− "repo": "old-ghc-nix",
413− "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8",
414− "type": "github"
415− },
416− "original": {
417− "owner": "angerman",
418− "ref": "master",
419− "repo": "old-ghc-nix",
420− "type": "github"
421− }
422− },
423− "root": {
424− "inputs": {
425− "flake-compat": "flake-compat",
426− "flake-utils": "flake-utils",
427− "haskellNix": "haskellNix",
428− "nixpkgs": [
429− "haskellNix",
430− "nixpkgs-unstable"
431− ]
432− }
433− },
434− "stackage": {
435− "flake": false,
436− "locked": {
437− "lastModified": 1658106847,
438− "narHash": "sha256-xcq/FgP1eNxaq7BaI+k0bkXfy+MFGib5I44VGGFQZdQ=",
439− "owner": "input-output-hk",
440− "repo": "stackage.nix",
441− "rev": "0fbfc3a3fb735e6bd5c81f614d8ed5308e501496",
442− "type": "github"
443− },
444− "original": {
445− "owner": "input-output-hk",
446− "repo": "stackage.nix",
447− "type": "github"
448− }
449− }
450− },
451− "root": "root",
452− "version": 7
453−}
backend/flake.nixdeleted−88
@@ -1,88 +0,0 @@
1−{
2− description = "A very basic flake";
3−
4− inputs = {
5− haskellNix.url = "github:input-output-hk/haskell.nix";
6− nixpkgs.follows = "haskellNix/nixpkgs-unstable";
7− flake-utils.url = "github:numtide/flake-utils";
8− flake-compat = {
9− url = "github:edolstra/flake-compat";
10− flake = false;
11− };
12− };
13−
14− outputs = { self, nixpkgs, flake-utils, haskellNix, flake-compat }:
15− flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system:
16− let
17− overlays = [
18− haskellNix.overlay
19− (self: super: {
20− gpr = self.grpc;
21− })
22− ];
23−
24−
25− compiler = "ghc8107";
26− pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
27−
28− project = { production }: pkgs.haskell-nix.cabalProject {
29− compiler-nix-name = compiler;
30− shell = {
31− exactDeps = false;
32− # crossPlatforms = p: [ p.ghcjs ];
33− tools = {
34− cabal = "latest";
35− haskell-language-server = "latest";
36− hlint = { };
37− # haskell-language-server = {
38− # version = "latest";
39−
40− # cabalProject = ''
41− # packages: .
42−
43− # package haskell-language-server
44− # flags: -haddockcomments
45− # constraints:
46− # some == 1.0.3
47− # '';
48− # modules = [{
49− # reinstallableLibGhc = true;
50− # }];
51− # };
52− };
53− };
54− src = ./.;
55− modules =
56− pkgs.lib.optional production {
57− ghcOptions = [
58− "-O2"
59− "-fexpose-all-unfoldings"
60− "-fspecialise-aggressively"
61− ];
62− dontStrip = false;
63− dontPatchELF = false;
64− enableDeadCodeElimination = true;
65− # packages.nobullshit-vpn.ghcOptions = [
66− # "-O2"
67− # "-fexpose-all-unfoldings"
68− # "-fspecialise-aggressively"
69− # "-Werror"
70− # ];
71− };
72− };
73− flake = (project { production = false; }).flake {
74− crossPlatforms = p: [ p.ghcjs ];
75− };
76− flakeProd = (project { production = true; }).flake { };
77− # presearch = flake.packages."presearch:exe:presearch";
78− in
79− flake // { packages.default = flake.packages."js-unknown-ghcjs:backend:exe:backend"; });
80− # {
81− # devShell = flake.devShell;
82− # packages = {
83− # # default = presearch;
84− # # presearch-bin = flakeProd.packages."presearch:exe:presearch" + "/bin/presearch";
85− # };
86− # inherit flake;
87− # });
88−}
backend/shell.nixdeleted−10
@@ -1,10 +0,0 @@
1−(import
2− (
3− let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
4− fetchTarball {
5− url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
6− sha256 = lock.nodes.flake-compat.locked.narHash;
7− }
8− )
9− { src = ./.; }
10−).shellNix
backend/src/FFI.hsdeleted−12
@@ -1,12 +0,0 @@
1−{-# LANGUAGE CPP #-}
2−
3−module FFI (launchElm) where
4−import Data.JSString (JSString)
5−
6−#ifdef __GHCJS__
7−foreign import javascript unsafe "Elm.Main.init({node: document.getElementById($1)})"
8− launchElm
9−#else
10−launchElm = undefined
11−#endif
12− :: JSString -> IO ()
backend/src/Main.hsdeleted−9
@@ -1,9 +0,0 @@
1−module Main (main) where
2−
3−import Data.JSString
4−import qualified FFI
5−
6−main :: IO ()
7−main = do
8− FFI.launchElm "elm"
9− putStrLn "Hello, Haskell!"
build.sh+7−3
@@ -1,7 +1,11 @@
1#!/bin/sh
1#!/bin/sh
2
2
3−elm make ${DEBUG_BUILD:+--debug} "$SRC_DIR/src/Main.elm" --output="$INSTALL_DIR/elm.js"
3+cp -r "$SRC_DIR"/static/* "$INSTALL_DIR"
4
4
5−rm "$SRC_DIR"/static/elm.js
5+rm "$INSTALL_DIR/elm.js"
6
6
7−cp -r "$SRC_DIR"/static/* "$INSTALL_DIR"
7+elm make --debug "$SRC_DIR/frontend/Main.elm" --output="$INSTALL_DIR/elm.js"
8+
9+rm "$INSTALL_DIR/backend.js"
10+
11+(cd "$SRC_DIR" && spago bundle-app --to "$INSTALL_DIR/backend.js")
clickable.yaml+1−11
@@ -10,17 +10,7 @@ image_setup:
10 # PATH: /opt/someprogram/bin:$PATH
10 # PATH: /opt/someprogram/bin:$PATH
11 run:
11 run:
12
12
13− # Elm
14−
15 - (cd /tmp && curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz && gunzip elm.gz && chmod +x elm && mv elm /usr/local/bin/)
13 - (cd /tmp && curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz && gunzip elm.gz && chmod +x elm && mv elm /usr/local/bin/)
14+ - npm install -g spago esbuild purescript --unsafe-perm=true
16
15
17− # Asterius
18−
19− # - apt-get update && apt-get install -y git binaryen automake autoconf nodejs npm python3
20−
21− # - curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
22−
23−
24−
25−# docker_image: terrorjack/asterius
26restrict_arch: all
16restrict_arch: all
dev/build-backend.sh+1−1
@@ -1,3 +1,3 @@
1#!/bin/sh
1#!/bin/sh
2
2
3−cp "$(nix build --print-out-paths ./backend)/bin/backend.jsexe/all.js" static/backend.js
3+spago bundle-app --to backend.js
dev/elm-live.sh+1−1
@@ -2,5 +2,5 @@
2
2
3(
3(
4 cd static &&
4 cd static &&
5− elm-live ../src/Main.elm --start-page=index.html --proxy-prefix=/api --proxy-host=http://localhost:6009 --pushstate -- --debug --output=elm.js
5+ elm-live ../frontend/Main.elm --start-page=index.html --proxy-prefix=/api --proxy-host=http://localhost:6009 --pushstate -- --debug --output=elm.js
6)
6)
src/Main.elm → frontend/Main.elmrenamed

The content is the same.

packages.dhallnew file+105
@@ -0,0 +1,105 @@
1+{-
2+Welcome to your new Dhall package-set!
3+
4+Below are instructions for how to edit this file for most use
5+cases, so that you don't need to know Dhall to use it.
6+
7+## Use Cases
8+
9+Most will want to do one or both of these options:
10+1. Override/Patch a package's dependency
11+2. Add a package not already in the default package set
12+
13+This file will continue to work whether you use one or both options.
14+Instructions for each option are explained below.
15+
16+### Overriding/Patching a package
17+
18+Purpose:
19+- Change a package's dependency to a newer/older release than the
20+ default package set's release
21+- Use your own modified version of some dependency that may
22+ include new API, changed API, removed API by
23+ using your custom git repo of the library rather than
24+ the package set's repo
25+
26+Syntax:
27+where `entityName` is one of the following:
28+- dependencies
29+- repo
30+- version
31+-------------------------------
32+let upstream = --
33+in upstream
34+ with packageName.entityName = "new value"
35+-------------------------------
36+
37+Example:
38+-------------------------------
39+let upstream = --
40+in upstream
41+ with halogen.version = "master"
42+ with halogen.repo = "https://example.com/path/to/git/repo.git"
43+
44+ with halogen-vdom.version = "v4.0.0"
45+ with halogen-vdom.dependencies = [ "extra-dependency" ] # halogen-vdom.dependencies
46+-------------------------------
47+
48+### Additions
49+
50+Purpose:
51+- Add packages that aren't already included in the default package set
52+
53+Syntax:
54+where `<version>` is:
55+- a tag (i.e. "v4.0.0")
56+- a branch (i.e. "master")
57+- commit hash (i.e. "701f3e44aafb1a6459281714858fadf2c4c2a977")
58+-------------------------------
59+let upstream = --
60+in upstream
61+ with new-package-name =
62+ { dependencies =
63+ [ "dependency1"
64+ , "dependency2"
65+ ]
66+ , repo =
67+ "https://example.com/path/to/git/repo.git"
68+ , version =
69+ "<version>"
70+ }
71+-------------------------------
72+
73+Example:
74+-------------------------------
75+let upstream = --
76+in upstream
77+ with benchotron =
78+ { dependencies =
79+ [ "arrays"
80+ , "exists"
81+ , "profunctor"
82+ , "strings"
83+ , "quickcheck"
84+ , "lcg"
85+ , "transformers"
86+ , "foldable-traversable"
87+ , "exceptions"
88+ , "node-fs"
89+ , "node-buffer"
90+ , "node-readline"
91+ , "datetime"
92+ , "now"
93+ ]
94+ , repo =
95+ "https://github.com/hdgarrood/purescript-benchotron.git"
96+ , version =
97+ "v7.0.0"
98+ }
99+-------------------------------
100+-}
101+let upstream =
102+ https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220706/packages.dhall
103+ sha256:7a24ebdbacb2bfa27b2fc6ce3da96f048093d64e54369965a2a7b5d9892b6031
104+
105+in upstream
spago.dhallnew file+17
@@ -0,0 +1,17 @@
1+{-
2+Welcome to a Spago project!
3+You can edit this file as you like.
4+
5+Need help? See the following resources:
6+- Spago documentation: https://github.com/purescript/spago
7+- Dhall language tour: https://docs.dhall-lang.org/tutorials/Language-Tour.html
8+
9+When creating a new Spago project, you can use
10+`spago init --no-comments` or `spago init -C`
11+to generate this file without the comments in this block.
12+-}
13+{ name = "backend"
14+, dependencies = [ "console", "effect", "prelude" ]
15+, packages = ./packages.dhall
16+, sources = [ "backend/**/*.purs" ]
17+}
test/Main.pursnew file+11
@@ -0,0 +1,11 @@
1+module Test.Main where
2+
3+import Prelude
4+
5+import Effect (Effect)
6+import Effect.Class.Console (log)
7+
8+main :: Effect Unit
9+main = do
10+ log "🍝"
11+ log "You should add some tests."