Questions tagged [ghcjs]

GHCJS is a Haskell to JavaScript compiler using the GHC API.

GHCJS is a Haskell to JavaScript compiler using the GHC API that supports many modern Haskell features, including:

  • All type system extensions supported by GHC
  • Lightweight preemptive threading with blackholes, MVar, STM, asynchronous exceptions
  • Weak references, CAF deallocation, StableName, StablePtr
  • Unboxed arrays, emulated pointers
  • Integer support through JSBN
  • Cabal support, GHCJS has its own package database
101 questions
2
votes
1 answer

Why do I get "ghcjs-boot: command not found"?

I've installed ghcjs by the command cabal install ./ghcjs ./ghcjs-prim And I get something like Updating documentation MyDir/Haskell/share/doc/x86_64-osx-ghc-7.8.3/index.html for my last line. But when I tried this command ghcjs-boot --dev I got…
Yiyue Wang
  • 152
  • 1
  • 12
1
vote
0 answers

How to set up GHCJS project which I can work on in IDEA?

I am using IntelliJ Haskell which adds Haskell support to IntelliJ IDEA. I believe the plugin only supports stack. I only found some old ghcjs options for stack which don't seem to work. So, how to create / set up a new project which compiles to…
menfon
  • 1,587
  • 1
  • 11
  • 28
1
vote
1 answer

How to convert Javascript object to JSVal

I'm working on my first GHCJS web application with Miso but I'm stuck on how to convert an GHCJS Object type into a JSVal to further use it. I can't find anything at all on how to do this... Any help is appreciated.
user2882307
1
vote
1 answer

jsaddle-dom import error suggests adding dependency I've already added

When trying to compile my ghcjs/jsaddle based Haskell website, I get Main.hs:20:1: error: Failed to load interface for ‘GHCJS.DOM.Element’ It is a member of the hidden package ‘jsaddle-dom-0.9.2.0’. Perhaps you need to add ‘jsaddle-dom’…
nh2
  • 24,526
  • 11
  • 79
  • 128
1
vote
1 answer

GHCJS: How to use a JS library that is intended to be used with npm

I'm using ghcjs-0.2.0.9006030_ghc-7.10.3 with stack lts-6.30 to build a frontend app. Inspired by this post, I decided to use react-flux and material-ui. I added React's CDN link to my index.html, and configured GHCJSi to use a custom index-dev.html…
Steven Feng
  • 61
  • 2
  • 5
1
vote
0 answers

Sequencing monadic actions where every action takes the original input

I'm currently experimenting with the JSaddle library in ghcjs. I don't have much of any experience with lenses yet. Somewhere in this library they seem to define a getter lens which is actually a sort of monadic…
rtytgat
  • 488
  • 2
  • 10
1
vote
1 answer

Stack setup error "solver must be one of: modular "

When running stack setup in Miso sample-app (https://github.com/dmjio/miso/tree/master/sample-app) following error occurred. Shorter version: exit status: 1 stderr: solver must be one of: modular CallStack…
Nagarjuna Pamu
  • 14,737
  • 3
  • 22
  • 40
1
vote
0 answers

`createTree: already exists (File exists)` error when running `ghcjs-boot`

When running ghcjs-boot I get a whole bunch of: ignoring unexpected entry type in tar. only normal files and directories (no links) are supported: ghcjs-boot/./@LongLink Before finally: ghcjs-boot:…
semicolon
  • 2,530
  • 27
  • 37
1
vote
0 answers

Error booting ghcjs in nixos from a stack project

I'm encountering an error running the boot stage of GHCJS in Nixos. GHCJS is being installed by stack with: stack setup And it fails during "installing stage 0" with: solver must be one of: modular My stack.yaml looks like: resolver:…
Jesuspc
  • 1,664
  • 10
  • 25
1
vote
0 answers

Reflex: Sending multiple http requests for a dynamic list of entries on event

Working with reflex-frp I have a list of entries which contain a text input. I also have a button that on click should trigger n http requests where n is the number of entries, and each request should contain the corresponding text. Therefore I…
Jesuspc
  • 1,664
  • 10
  • 25
1
vote
0 answers

increase memory for node as called by ghcjs

I get this error from time to time when I run ghcjs on a large-ish code base (~10k LOC, lots of template haskell): fd:40: hPutBuf: illegal operation (handle is closed) my best bet is that this is an out-of-memory error. when i re-run the build it…
user2645074
  • 107
  • 8
1
vote
1 answer

Conditionally adding DOM elements with Reflex

I have a function that receives a Dynamic and has to display a dom element which will contain a different kind of child depending on the value in the Dynamic. Is there a way to do such thing using Reflex and Reflex-Dom? The code would look like this…
Jesuspc
  • 1,664
  • 10
  • 25
1
vote
0 answers

Does GHCjs support hot code reloading?

Couldn't find the answer on google. Something like https://github.com/bhauman/lein-figwheel which is for Clojurescript.
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
1
vote
0 answers

How do I use hdevtools with ghcjs within stack

So it looks like hdevtools cannot be directly used with ghcjs. Using stack install hdevtools within a GHCJS stack project gives me: Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for…
semicolon
  • 2,530
  • 27
  • 37
1
vote
1 answer

how to change

tags with ghcjs-dom

I have found the ghcjs and ghcjs-dom documentation very limited. Here is this basic HTML document. h1 { font-family: Helvetica; } p {font-family: Helvetica; color: blue; }

Hello World

This is my test document.

I…
john mangual
  • 7,718
  • 13
  • 56
  • 95