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

Should Nullable also be an instance of IsJSVal and PToJSVal? #90

Open louispan opened 7 years ago

louispan commented 7 years ago

At least if it's an instance of IsJSVal, then I can have easily (without pattern matching) the the jsval of nullableJO :: Maybe JavaScript.Object -> JSVal nullableJO obj = jsval (maybeToNullable obj)

I can't use pToJsVal directly because JavaScript.Object is not an instance of PToJSVal, but it's an IsJSVal.