meiersi / blaze-react

A blaze-html style ReactJS binding for Haskell using GHCJS
MIT License
107 stars 15 forks source link

Support JSString in ChoiceString when compiling with ghcjs #32

Open waern opened 9 years ago

waern commented 9 years ago

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

meiersi-da commented 9 years ago

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.

asayers commented 9 years ago

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

meiersi-da commented 9 years ago

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.

asayers commented 9 years ago

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