Closed kfish closed 9 years ago
One simple (and perhaps better?) solution for this is to have a top level module that imports both Foo and Bar.
Ah! I can make a toplevel module Main.hs that does nothing but import:
module Main where
import Foo
import Bar
and build it with:
fay --package fay-text Main.hs
it does the right thing, without any interference between Foo and Bar. When generating modules to call from javascript, I can do:
fay --package fay-text Main.hs --strict Foo,Bar
which will create Main.js, defining Strict.Foo and Strict.Bar. That worksforme.
(We could probably fiddle it so that giving multiple arguments is equivalent to compiling such an import-only module)
Also related to #330 by the way.
Some possible solutions:
--library
would be implicit for multiple inputsI'll reopen this, the current behavior is unintuitive/broken.
Spring cleaning. Lack of activity, it's unlikely that this will happen. Use a top level module.
I would like to structure my Haskell code in separate files (one file per module, as Haskell requires), but generate one output javascript file.
Currently, if I use a commandline like:
then fay will:
So -o cannot be used with multiple files.
If I instead use multiple invocations:
then the resulting Foo.js and Bar.js will contain redundant copies of the same code (RTS, stdlib and fay-text library code). If I build with --no-stdlib --library, then I still get redundant copies of fay-text.