Skip to content

docs: correct wrong import of PS inside JS in FFI.md #468

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions guides/FFI.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ This function finds the greatest common divisor of two numbers by repeated subtr
To understand how this function can be called from Javascript, it is important to realize that PureScript functions always get turned into Javascript functions _of a single argument_, so we need to apply its arguments one-by-one:

``` javascript
import { gcd } from 'Test';
import { gcd } from '../Test/index.js';
gcd(15)(20);
```

Here, I am assuming that the code was compiled with `psc`, which compiles PureScript modules to ES modules. For that reason, I was able to import the `gcd` function from the `Test` module.
You may also be able to use `import { gcd } from 'Test';` construction if you compile the code with `psc`, which outputs ES modules.

#### Understanding Name Generation

Expand Down