blaze-react
blaze-react copied to clipboard
Support JSString in ChoiceString when compiling with ghcjs
This avoids costly conversions if you're writing an SPA and have JSStrings in your state.
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.
And you'd use backpack to swap out the different implementations?
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.
Oh yes, that also sounds like it would work (and has the benefit of using technology which exists).