Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghcjs-dom and OverloadedStrings interact very poorly due to ToJSString proliferation #111

Open
tysonzero opened this issue Jun 4, 2024 · 0 comments

Comments

@tysonzero
Copy link

There is of course the argument that polymorphic function inputs and monomorphic literals is the "right" way to do things, but that ship seems to more or less have sailed, and personally I can't say I disagree with it, particularly given that even pre-OverloadedStrings Haskell went that route with Num literals.

Very few libraries take in ToXXXString a => a arguments, and the libraries that are more polymorphic in string usage are generally that way because the same string type appears in both the input and the output, for example mono-traversable.

For that reason I think ghcjs-dom should plan to transition to monomorphic JSString inputs, with end users being encouraged to use OverloadedStrings and the occasional explicit toJSString.

Note that this is just about ToJSString, I'm not currently trying to change any ToJSVal usages.

Currently I'm having to do a lot of: foo @_ @JSString @JSString "bar" "baz" type stuff and it's rather unpleasant to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant