<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">port</a> of <a href="https://github.com/agocorona/haste-perch">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">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>