ghcjs / ghcjs-base

base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC
MIT License
45 stars 67 forks source link

IsString instance for JSVal #92

Open louispan opened 7 years ago

louispan commented 7 years ago

Can we add the following instance to GHCJS base?

instance IsString JSVal where
  fromString = jsval . Data.JSString.pack

This will make it easier to use OverloadedStrings to put JSString into JSVal (eg. as the value of a property of JavaScript.Object).

hamishmack commented 7 years ago

Sounds good to me.