purescript-d3 icon indicating copy to clipboard operation
purescript-d3 copied to clipboard

Taking a crack at swapping out easy-ffi for eff-functions

Open afcondon opened this issue 8 years ago • 3 comments

Hi, just FYI i'm working on replacing all the easy-ffi calls with calls using purescript-eff-functions eff-functions instead.

If it works out, and if you want to, i'll be happy to make a PR available when it's done.

afcondon avatar Mar 10 '16 10:03 afcondon

Can you help me understand what the advantage is?

pelotom avatar Mar 15 '16 21:03 pelotom

I can't say as yet whether there definitively is an advantage but the advantages that i foresaw were:

  • being able to write more (all?) of the code in PureScript
  • avoiding on-the-fly compilation of inlined FFI code
  • stronger typing
  • possible code-gen possibilities or automatic derivation of the FFI bindings (speculative)

Additionally i have a particular use-case where i wish to use another purescript library purescript-pux from the callbacks associated with elements in the D3 SVG or HTML structure.

Where i'm at now with this is that i have everything working that i wanted to get working. I'm now trying to see how much else i might have to implement in order to really be able to write only in purescript for the D3. My plan would be to add features as i need them (i know i will need zoom, for example). For example, i have added classed and i'm about to add datum.

I think the D3 DSL you created is a really great example of the expressiveness of Haskell / Purescript even for very much non-pure API's such as D3. I'm interested in pushing that as far as it goes.

afcondon avatar Mar 20 '16 18:03 afcondon

Cool, would be happy to entertain a pull request, and it'd be great to see some examples of how the change enables your use case. Growing the library as we want to make use of various parts of D3 is exactly my philosophy for this project. Glad you're finding it useful!

pelotom avatar Mar 21 '16 02:03 pelotom