Describe the bug
When using foreign export javascript to export a Haskell function, the function appears in __asterius_jsffi.exports if the code is compiled with ahc-link, but not if it is compiled with ahc-dist.
To Reproduce
I wrote a short program which exports mult_hs and then checks if __asterius_jsffi.exports.mult_hs exists:
$ cat Example.hs
{-# LANGUAGE ForeignFunctionInterface #-}
foreign export javascript "mult_hs" (*) :: Int -> Int -> Int
foreign import javascript "console.log(__asterius_jsffi.exports.mult_hs)" js_print_exports :: IO ()
main :: IO ()
main = js_print_exports
$ cat example.cabal
cabal-version: 2.4
name: example
version: 0.1.0.0
executable example-exe
main-is: Example.hs
build-depends: base
hs-source-dirs: .
Inside the asterius image, I then compile and run that code using ahc-link and ahc-dist, and get two different results:
Describe the bug When using
foreign export javascript
to export a Haskell function, the function appears in__asterius_jsffi.exports
if the code is compiled withahc-link
, but not if it is compiled withahc-dist
.To Reproduce
I wrote a short program which exports
mult_hs
and then checks if__asterius_jsffi.exports.mult_hs
exists:Inside the asterius image, I then compile and run that code using
ahc-link
andahc-dist
, and get two different results:Expected behavior
I expected the
ahc-dist
command to produce[AsyncFunction: cb]
as well.Environment
terrorjack/asterius:210111