Skip to content

Instantly share code, notes, and snippets.

@mgsloan

mgsloan/paste.md Secret

Last active November 30, 2015 12:22
Show Gist options
  • Save mgsloan/b33f071f99f73810acff to your computer and use it in GitHub Desktop.
Save mgsloan/b33f071f99f73810acff to your computer and use it in GitHub Desktop.
  • Remove the type parameters from JSRef.

  • Turn declarations like this:

    type Foo = JSRef Foo_
    data Foo_

    into

    newtype Foo = Foo JSRef
  • ToJSString / FromJSString were removed. ghcjs-dom has some similar utilities, but a different API. Seems like a good idea to keep them around. See ghcjs/ghcjs-base#30

  • GHCJS.Foreign.newObj became JavaScript.Object.create (and getProp, setProp, etc got moved there too).

  • release became releaseCallback

  • Callback stuff dropped the retention parameter, and changed the Bool to OnBlocked. True becomes ContinueAsync, and False becomes ThrowWouldBlock

  • You should just use Data.Coerce.coerce instead of castRef

@geraldus
Copy link

Thank you! This is quite helpful. What about arrays?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment