blaze-react icon indicating copy to clipboard operation
blaze-react copied to clipboard

Support JSString in ChoiceString when compiling with ghcjs

Open waern opened this issue 10 years ago • 4 comments

This avoids costly conversions if you're writing an SPA and have JSStrings in your state.

waern avatar Oct 28 '15 12:10 waern

Thanks for the PR. I wonder whether there wouldn't be the possibility for a version of the Text library that uses JSString internally, but is API compatible with the default text library. That would allow us to get rid of the #ifdefs.

meiersi-da avatar Oct 29 '15 07:10 meiersi-da

And you'd use backpack to swap out the different implementations?

asayers avatar Oct 29 '15 08:10 asayers

Hmm..interesting. I was thinking about conditionals in the cabal file, which would probably be placed in a text frontend library that includes text-native or text-ghcjs depending on the compiler that it is compiled with.

meiersi-da avatar Oct 29 '15 14:10 meiersi-da

Oh yes, that also sounds like it would work (and has the benefit of using technology which exists).

asayers avatar Oct 29 '15 14:10 asayers