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
0
votes
1 answer

Including module in haskell during ghcjs in compile time

I want to compile a haskell code to javascript and have the following error during compiling. > ghcjs Main.hs Main.hs:2:8: Could not find module ‘Reflex.Dom’ Use -v to see a list of the files searched for. Main.hs:4:8: Could not find…
Akash
  • 939
  • 1
  • 8
  • 27
0
votes
2 answers

how to code

tags with ghcjs

I have found the ghcjs 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.

Is ghcjs just a…
john mangual
  • 7,718
  • 13
  • 56
  • 95

0
votes
1 answer

how do I add ghcjs to path?

In order to install ghcjs I upgraded to Ubuntu 16.04 No problem with requirements. alex and happy where automitcally installed. Then: $ git clone https://github.com/ghcjs/ghcjs.git $ cabal install ./ghcjs However, I cannot call ghcjs from…
john mangual
  • 7,718
  • 13
  • 56
  • 95
0
votes
1 answer

Filter [Node] to [Element] with ghcjs-dom

I am using ghcjs-dom. How can I filter the elements out of an array of nodes? import GHCJS.DOM.Types nodesToElements :: [Node] -> [Element] nodesToElements = ?? or nodesToElements :: [Node] -> IO [Element] nodesToElements = ??
michaelmesser
  • 3,601
  • 2
  • 19
  • 42
0
votes
1 answer

Is there a built in function to convert a NodeList to a real list (ghcjs-dom)?

How can I convert the result of Element.querySelectorAll body "h1" which is IO NodeList to IO (List Node). I know I could write a function myself. Is there a builtin function?
michaelmesser
  • 3,601
  • 2
  • 19
  • 42
0
votes
1 answer

Yesod - shared types between server and client

I'm used to working with Dart, where sharing types between server and client is as simple as importing the relevant packages into your project. Can something similar be accomplished with Yesod/Haskell? Should I use GHCJS for the client? Maybe Elm?…
Thomas Løcke
  • 605
  • 4
  • 8
0
votes
1 answer

What might this ghcjs-boot error mean?

I'm trying to try out GHCJS, and I get this error during ghcjs-boot: (https://gist.github.com/Wizek/e4a73c6e9542a119ddd6) ➜ ghcjs-test load-env-ghc7103 ghcjs-boot env-ghc7103 loaded program ghcjs found at ./.cabal-sandbox/bin/ghcjs program…
Wizek
  • 4,854
  • 2
  • 25
  • 52
0
votes
2 answers

How to get the current time with GHCJS?

How to get the current time with GHCJS? Should i try to access Date or use Haskell base libraries? Is there an utility function somewhere in the GHCJS base libraries?
danza
  • 11,511
  • 8
  • 40
  • 47
0
votes
1 answer

ghcjs-dom-hello world does not respond to mouse clicks - ghc 7.10.1

I suppose this example should respond to mouse clicks: https://github.com/ghcjs/ghcjs-dom-hello , right ? But when I try it with GHC 7.10.1 under Firefox and Chrome nothing happens when I click on the page. Any ideas ? I haven't tried it with GHC…
jhegedus
  • 20,244
  • 16
  • 99
  • 167
0
votes
2 answers

Failed to install ghcjs-dom-0.0.7 - src/GHCJS/DOM.hs:3:14: Unsupported extension: JavaScriptFFI

I have problems installing Leksah, the depends on ghcjs-dom: Here's what I precisely get when trying to install this precise package: $ cabal install ghcjs-dom -v Reading available packages... Choosing modular solver. Resolving dependencies... Ready…
Bastien Gallay
  • 366
  • 3
  • 3
0
votes
1 answer

Can't access localhost:3030 on OS X 10.9.1 Mavericks

I've installed GHCJS VM using vagrant, then successfuly compiled and run "Hello World" example in both node and js. But when I try vagrant ssh -c warp Serving directory /home/vagrant on port 3000 with ["index.htm","index.html"] index…
Geradlus_RU
  • 1,466
  • 2
  • 20
  • 37
1 2 3 4 5 6
7