<div dir="ltr">The way Fay handles this is to set the `FAY` variable for CPP so you can use `#ifdef FAY`. I then usually have a module Foo.GHC and Foo.Fay imported conditionally. Perhaps something similar is applicable here?<div><br></div><div>HTH,</div><div>Adam</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 24, 2015 at 10:30 AM, Geraldus <span dir="ltr"><<a href="mailto:heraldhoi@gmail.com" target="_blank">heraldhoi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Cafe!<div><br></div><div>I've written very first version of GHCJS <a href="https://github.com/geraldus/ghcjs-perch" target="_blank">port</a> of <a href="https://github.com/agocorona/haste-perch" target="_blank">Perch</a> library originally designed to work with Haste compiler.  Most of work is already done, though some polishing is needed.  In essence Haste and GHCJS versions are very similar, the major difference is how foreign functions are defined, and in fact Perch is built using just a <a href="https://github.com/geraldus/ghcjs-perch/blob/master/src/Internal/FFI.hs" target="_blank">few low-level primitives</a>.</div><div><br></div><div>So, as these libraries are very similar I want to generalize Perch to make it independent of compiler somehow.</div><div><br></div><div>My initial idea was to have a Perch library and several compiler specific back-ends which user should select depending on his toolchain, but my Haskell skills are still very poor to find a proper way to do this.  Can someone point me in right direction or at least give some advices?</div><div><br></div><div>Very appreciate any help!</div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><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>
<br></blockquote></div><br></div>