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

Consolidate "FFI" and "FFI tips" #56

Open
soupi opened this issue Mar 23, 2017 · 7 comments
Open

Consolidate "FFI" and "FFI tips" #56

soupi opened this issue Mar 23, 2017 · 7 comments

Comments

@soupi
Copy link
Contributor

soupi commented Mar 23, 2017

It have been asked a few times on IRC:

  • "How do I return an Either String Int from JS?"
  • "How do I return MyCustomDatatype from JS?"

Two solutions that were brought up were to:

  • send the possible data constructors to be return (example, Left, Right, MyCustomDatatypeConstructor`, etc.),
  • send a function of type String :: Maybe MyCustomDatatype that will get a string version of that constructor and will decide which value to return based on that.

It'd be great if that'd be documented in the FFI guide. :)

@garyb
Copy link
Member

garyb commented Mar 23, 2017

What, like this? 😄

@garyb
Copy link
Member

garyb commented Mar 23, 2017

Agreed it should be more prominent / perhaps expanded though.

@soupi
Copy link
Contributor Author

soupi commented Mar 23, 2017

Ah, sorry! I skimmed the document a few times and concluded that part wasn't documented but here it is...

@garyb
Copy link
Member

garyb commented Mar 23, 2017

It's under "FFI Tips" rather than just "FFI" in the guides, we should probably consolidate them :)

@chexxor
Copy link
Collaborator

chexxor commented Mar 23, 2017

Oh nice! I didn't know that was documented. We need to improve the organization of this repo.

@soupi
Copy link
Contributor Author

soupi commented Mar 23, 2017

oh, missed it again. Yeah it would definitely help to merge the two guides.

@hdgarrood hdgarrood changed the title Document in the FFI document how to return PureScript data types from JavaScript functions Consolidate "FFI" and "FFI tips" Jul 8, 2017
@hdgarrood
Copy link
Collaborator

There's also an FFI page under "language". I think we should try to put it all under the language one.

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

No branches or pull requests

4 participants