faylang / fay

A proper subset of Haskell that compiles to JavaScript
https://github.com/faylang/fay/wiki
BSD 3-Clause "New" or "Revised" License
1.29k stars 86 forks source link

Usage of additional package in Fay-code #429

Closed denisshevchenko closed 9 years ago

denisshevchenko commented 9 years ago

Hi!

I try to use additional package in my Fay-code. This is raw-strings-qq, and it already installed (globally, not in sandbox). So I try to compile:

$ fay --Wall --package fay-jquery,fay-text,raw-strings-qq --include=./templates/home/register/form/ templates/home/register/form/Form.hs -o static/js/Form.js

but:

fay: unable to find (existing) package's share dir: raw-strings-qq
tried: /Users/dshevchenko/Library/Haskell/share/ghc-7.8.3-x86_64/raw-strings-qq-1.0.2
/Users/dshevchenko/Library/Haskell/share/ghc-7.8.3-x86_64/raw-strings-qq-1.0.2/src

Why share dir with sources instead of .hi-file?? How can I specify path to this package?

bergmark commented 9 years ago

Hi @denisshevchenko,

In short, you can't use raw-strings-qq with Fay.

Most haskell packages are not compatible with fay, and template haskell is notably not supported either. I think it's safe to say that all fay compatible packages have a dependency on fay-base. If you wish to use existing haskell packages you should look into Haste or GHCJS instead, though I'm not sure how far GHCJS has gotten with template-haskell support.

Fay compiles all dependencies from source, it would need separate compliation artifacts to support using already compiled code. This is what #324 is about.

Hope this helps,

denisshevchenko commented 9 years ago

Ok, thanks.

If you wish to use existing haskell packages you should look into Haste or GHCJS instead...

No, I like Fay.

bergmark commented 9 years ago

:)