GHCJS

Simon Peyton-Jones simonpj at microsoft.com
Thu Aug 4 22:02:42 CEST 2011


|  data LiteralDesugaring m =
|    LiteralDesugaring
|      { desugarInt :: MonadThings m => Integer -> m CoreExpr
|      , desugarWord :: MonadThings m => Integer -> m CoreExpr
...

I am not sure why you want to control the desugaring of literals.  Why literals?  And why is literals enough?

|  But I don't still understand what can I do with foreign
|  imports/exports. DsForeign module seems to be too complicated. As I
|  can see, I shouldn't make whole dsForeigns function replaceable, but I
|  can't understand what part of it should be replaceble.

I still think that the stub generation for foreign declarations should be easily separable.   The desugarer generates a certainly amount of unwrapping, but you'll want that for JavaScript too. The actual calling convention is embedded inside the Id: see the FCallId constructor of IdDetails in IdInfo.lhs, and the ForeignCall type in ForiegnCall.lhs.

Simon


More information about the Glasgow-haskell-users mailing list