Question

I'm having trouble compiling a working Haskell library to JavaScript using Fay.

I believe I've successfully installed Fay using cabal-dev, and set the HASKELL_PACKAGE_SANDBOX environment.

When I attempt to compile, I get the following:

 C:\ror>cabal-dev\bin\fay --package fay-base --library --include src src\IRR.hs
 fay: ghc:
 src\Period.hs:27:8:
     Could not find module `Data.Function'
     It is a member of the hidden package `base'.
     Use -v to see a list of the files searched for.

Using ghc-pkg list I can see that base-4.6.0.1 is exposed.

Any hints on what to try next?

Thanks! N

Was it helpful?

Solution

This is not specific to windows or cabal-dev.

When typechecking Fay passes -hide-package base to GHC, otherwise it would conflict with fay-base. Fay wouldn't be able to use the installed base either way, it needs the source files and base contains a lot of things that Fay doesn't support.

fay-base doesn't define Data.Function, the only reason is that the module hasn't been implemented (please send a PR if you add it!)

You don't need to compile with --package fay-base by the way, it's implicit.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top