Search code examples
haskellghcjs

How to convert Javascript object to JSVal


I'm working on my first GHCJS web application with Miso but I'm stuck on how to convert an GHCJS Object type into a JSVal to further use it. I can't find anything at all on how to do this...

Any help is appreciated.


Solution

  • Assuming Object is this Object then it's an instance of IsJSVal which defines:

    jsval :: IsJSVal a => a -> JSVal