<div dir="ltr"><div>Thanks for the questions.</div><div><br></div>1. Yes, network I/O is excluded.  The only real exceptions here are stdin/err/out, and code that's specifically written to work in GHCJS, such as JavaScript.Web.XMLHttpRequest and JavaScript.Web.WebSocket modules in ghcjs-base.<div><br></div><div>2. Depending on bytestring is fine, because it has a shim that makes it work with GHCJS.  I believe <a href="https://github.com/ghcjs/ghcjs/tree/ghc-8.6/lib/boot/shims">https://github.com/ghcjs/ghcjs/tree/ghc-8.6/lib/boot/shims</a> is a list of shimmed libraries that you don't need to worry about depending on.</div><div><br></div><div>3. Exporting inessential TH features is fine.  It's just that people attempting to use your library via CodeWorld won't be able to use them, since CodeWorld's web interface will refuse to build anything that enables Template Haskell.</div><div><br></div><div>It looks like your project is completely excluded only because of the network I/O.  If the network I/O is not necessary and you could exclude the dependency using a combination of "#ifdef ghcjs_HOST_OS" in source and "if impl(ghcjs)" in the cabal file, then it could still work.  But, of course, of the network I/O is the whole point, then it's not going to work out.  JavaScript</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 1, 2020 at 2:30 PM Viktor Dukhovni <<a href="mailto:ietf-dane@dukhovni.org" target="_blank">ietf-dane@dukhovni.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Jun 01, 2020 at 11:37:12AM -0400, Chris Smith wrote:<br>
<br>
> <a href="https://github.com/google/codeworld/blob/master/codeworld-available-pkgs/codeworld-available-pkgs.cabal" rel="noreferrer" target="_blank">https://github.com/google/codeworld/blob/master/codeworld-available-pkgs/codeworld-available-pkgs.cabal</a><br>
> <br>
> Packages that fit here are:<br>
> <br>
> 1. No I/O, except for stdin/out/err.  Since CodeWorld runs code in a web<br>
> browser, there is no filesystem, for example.<br>
<br>
I assume this also precludes network I/O?<br>
<br>
> 2. Do not rely on native libraries, or have dependencies that do.  This all<br>
> depends on the library building with GHCJS.<br>
<br>
I guess this also excludes `bytestring`, which uses memcpy(), memchr(),<br>
and writes directly allocated memory?<br>
<br>
    -- | Wrapper of 'mallocForeignPtrBytes' with faster implementation for GHC<br>
    --<br>
    mallocByteString :: Int -> IO (ForeignPtr a)<br>
    mallocByteString = mallocPlainForeignPtrBytes<br>
<br>
and all of its dependencies?<br>
<br>
> 3. Do not require use of Template Haskell by clients.  It's okay if your<br>
> package needs template Haskell to build, but people using your library via<br>
> CodeWorld cannot yet use TH themselves.<br>
<br>
Is it that Template Haskell features in modules are not available to<br>
users, or that modules that export even "inessential" TH features are<br>
precluded.<br>
<br>
For example, can the platform support a module that exports a<br>
convenience TH "splice", if the same can be done slightly less<br>
conveniently (e.g. run-time, rather than compile-time error checks) at<br>
runtime via alternative functions?<br>
<br>
[ My current project does network I/O, uses `bytestring`, and provides<br>
  TH-splices for two types of compile-time validated literals, so I<br>
  would assume is a non-starter on all three counts. ]<br>
<br>
-- <br>
    Viktor.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>