Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FFI and use runFnX #5

Merged
merged 1 commit into from
Jul 22, 2014
Merged

Update FFI and use runFnX #5

merged 1 commit into from
Jul 22, 2014

Conversation

garyb
Copy link
Member

@garyb garyb commented Jul 20, 2014

Maybe this is the pattern we should encourage everywhere for FFIs, as now the implementations are safe from any further codegen changes too (unless we do something crazy).

Ideally we could be cleverer with runFnX, as none of the calls in here will be inlined as the application isn't complete, but if we could inline definitions like readPrimType, readMaybeImpl' where they just call runFnX then there's a better chance the full optimization will be applied later.

garyb referenced this pull request in michaelficarra/purescript-spidermonkey-ast Jul 20, 2014
also get rid of readExpr and make read total
\ return Data_Either.Left('Value is not a ' + typeName + ''); \
\ }; \
\}" :: forall a. String -> Foreign -> Either String a
\}" :: Fn3 (String -> Either String Foreign) (Foreign -> Either String Foreign) String (Either String Foreign)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nb. Could give this a more general polymorphic type.

@paf31
Copy link
Contributor

paf31 commented Jul 21, 2014

👍

garyb added a commit that referenced this pull request Jul 22, 2014
@garyb garyb merged commit 8f8c1c9 into master Jul 22, 2014
@garyb garyb deleted the ffi-update branch July 22, 2014 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants