Open louispan opened 7 years ago
I think the same could be said of all the instances of pFromJSVal apart from the Maybe instance. When we use pFromJSVal we have to make sure the JSVal is valid and of the correct type. If it might be null we can use something like:
print . maybe "Value was null" unpack . pFromJSVal $ nullRef
I see. So the pFromJSVal is an 'unsafe' interface like unsafeCoerce. Maybe the comments could be updated to that effect?
AFAIK JSString should never contain null or undefined.
However, it is an instance of PFromJSVal, which means the following compilable code will crash