Skip to content

Ch10 showNumber fix and more FFI examples#57

Merged
hdgarrood merged 1 commit intopurescript-contrib:masterfrom
milesfrain:ch10-ffi-examples
Apr 10, 2020
Merged

Ch10 showNumber fix and more FFI examples#57
hdgarrood merged 1 commit intopurescript-contrib:masterfrom
milesfrain:ch10-ffi-examples

Conversation

@dwhitney
Copy link
Collaborator

dwhitney commented Mar 21, 2020 via email

Notice that `shout` is compiled to a (curried) function of two arguments, not one. The first argument `dict` is the type class dictionary for the `Show` constraint. `dict` contains the implementation of the `show` function for the type `a`.

We can call this function from JavaScript by passing an explicit type class dictionary from the Prelude as the first parameter:
We can call this function from JavaScript by passing an explicit type class dictionary from the `Data.Show` as the first parameter:

Choose a reason for hiding this comment

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

I’d probably remove the “the” before the module name here, personally

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Applied suggestion in latest force-push

@milesfrain
Copy link
Member Author

I think we ought to move this book elsewhere.

I agree. Bumped the book thread to nag about transferring to purescript-contrib.

@hdgarrood hdgarrood merged commit f7dc979 into purescript-contrib:master Apr 10, 2020
@milesfrain milesfrain deleted the ch10-ffi-examples branch April 12, 2020 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants