Helper functions that make writing callbacks for JS libraries in purescript easier.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src/Data/Foreign
test
.gitignore
LICENSE
README.md
bower.json

README.md

purescript-foreign-callbacks

Helper functions that make writing callbacks for JS libraries in purescript easier.

A lot of JS libraries allow callback actions to be defined, such as in response to click events, etc. These are effectful functions that accept input and perform some kind of action (e.g. update the DOM, send a message, whatever).
This library defines purescript types for these kinds of callbacks. JS library callbacks that are not effectful can be handled with the FnX types in the Data.Function module of the prelude.

Usage

See the doc for full list of functions.

Each CallbackX type is analogous to the FnX types of the prelude. The callbackX functions are analogous to the mkFnX functions of the prelude. callbackX_ functions can be used to ignore the input arguments of the callback and run the effect.