34 questions
0
votes
1
answer
47
views
Fay cannot find package fay-base
I want to try compile Haskell code to JS using fay.
I ran commands:
cabal install fay
cabal install fay-base --lib
export PATH="$HOME/.cabal/bin:$PATH"
fay index.hs
And got the following ...
3
votes
1
answer
153
views
Fay can't find fay-base
I want to use Fay with Yesod, but can't get Fay typechecking to work.
Will appreciate any advice.
$ stack build ...
0
votes
0
answers
42
views
Fay: how to show a value and use this string in JS?
I'm mixing old JS and new Fay-generated JS, and I'm trying to get a string representation of some data from Fay. I defined
jshow :: Bool -> String
jshow d = show d
It's not just a Bool in the real ...
1
vote
0
answers
60
views
Data.Tree for Fay
I am using Data.Tree.unfoldTree in a Fay script but it cannot be compiled and it is not included in fay-base. Is there a way to import from Data.Tree?
2
votes
0
answers
184
views
Serializing Maybe types
What is the correct type for serializing Maybe types?
Given I have some data structure of Maybe type on the server and I serialize it with showToFay function, then it won't become one of the {"...
0
votes
1
answer
35
views
Derive Monad from Fay newtype in order to enable do notation
I want to create a different classes of side-effecty functions, so I can mark some of the side-effects as safer than other ones.
I'd like to create a newtype over the Fay side-effect monad and use it ...
0
votes
1
answer
33
views
Passing records to ffi
When I pass a record to javascript, it works:
data Record = Record {
elem :: String
}
doSomethingForeign :: Record -> Fay ()
doSomethingForeign = ffi " callJsFun(%1) "
But when the function is ...
3
votes
1
answer
217
views
Haskell Fay sequence async calls
Recently, I decided to port some javascript code to Fay, so that I could guarantee type correctness, and so that I could handle async in a neat way (and also to experiment). I had built a few ...
0
votes
1
answer
464
views
Example of .cabal file for fay project
I have a simple web app written with scotty.
I would like to use fay to generate the front-end JS code and use shared types between the frontend and the backend.
At the moment, I run my app using ...
0
votes
1
answer
201
views
fay Could not find module `Control.Applicative'
foo.hs
import Control.Applicative
then
fay foo.hs
returns
Could not find module `Control.Applicative'
It is a member of the hidden package `base'.
Use -v to see a list of the files searched for.
...
2
votes
1
answer
148
views
Haskell cabal compile .js during build
Let's say I'm building a web application with haskell as both server-side and client-side code. During the build phase, I want to compile server-side code with ghc and client-side code with some ...
1
vote
1
answer
263
views
How do I install fay?
I'm running ubuntu 13.10 and I'm having trouble installing fay. I installed haskell using sudo apt-get install haskell-platform . I try cabal install fay and I receive the following message:
$ cabal ...
2
votes
0
answers
382
views
Yesod Fay - Uncaught ReferenceError: XXX is not defined
I'm trying to set up Yesod, while running Fay for the frontend of my site. It's mostly working as I'd expect, as in any Fay I write runs. The problem is I'm getting an Uncaught ReferenceError in the ...
1
vote
1
answer
120
views
Connect legacy Haskell code and Fay code
I have some Haskell code, and would like a Fay script to be able to access it. The problem is the Haskell code uses monads. Fay doesn't support arbitrary monads. How do I get my Haskell code to work ...
3
votes
1
answer
251
views
Using Fay in a cabal sandbox
I've just started using both cabal sandboxes and Fay. However, Fay seems unable to find the packages automatically, presumably as they are not in the 'global' cabal package database. I tried ...