3

I would like to produce an HTML / JS page with reflex-dom (only client side, frontend). However, I use the singletons package (2.6) and it seems that it cannot be compiled with ghcjs or ghc 8.6.5 (singletons 2.5.1, broken-unpatched). Therefore, the reflex-platform solutions, reflex-stone or equivalent did not help me.

I saw that ghcjs 8.8 or 8.10 could be installed through haskell.nix, but I did not find how.

How can I do it? Or maybe, is there a way to use GHCJS (or reflex-platform solutions) with recent packages (that need ghc 8.8 or +)? Is there a way to use ghcjs-8.8 or 8.10 with the reflex-platform?

2 Answers2

1

First of all I would like to highlight that I'm not in any way related to GHC or GHCJS projects development, just another person who encountered similar issues, so take it with a grain of salt.

Currently GHCJS supports <= 8.6.5 out of the box. There is some development going on now and we will probably see officially supported 8.10 soon.

Meanwhile you can try to build the following branches on your own risk: 8.10 8.8

Dmitry Kovriga
  • 238
  • 3
  • 8
  • Thank you, Dmitry. Indeed, I tried but I did not succeed in building these branches, due to compatibility issues with my own packages. Consequently, I splitted my project in two : a full-GHC backend API using servant, in order to use singletons 2.6+, sending only Strings and Booleans to a reflex frontend (with servant-reflex). – Ludovic Mignot Apr 23 '21 at 05:22
0

The ghcjs-8.10.7 compiler is in the nixpkgs-unstable branch, so you should be able to nix-build haskell.compiler.ghcjs810. Note that after commit 41f40771488e99c914a3da5de086cf794242c6d7 something happened to make it stop building, I don't know if this has been resolved. But if you rewind to that point your build should work.

Note also that it produces very large and rather slow executables because the optimizer is disabled. Ghcjs-8.6.0.1 is more usable in this respect.

David Fox
  • 654
  • 4
  • 10