1Foreign Function Interface
2==========================
7The `foreign import` keyword declares a value which is defined in Javascript, and its type::
9 foreign import pow :: Number -> Number -> Number
14A foreign import declaration may optionally contain its definition in Javascript as a string literal. If this is provided, the string will be inserted directly into the generated Javascript before the current module definition::
16 foreign import pow "function pow(n) {\
17 \ return function(p) {\
18 \ return Math.pow(n, p);\
20 \}" :: Number -> Number -> Number
25To declare a new type with no constructors, use `foreign import data` and provide the kind::
27 foreign import data DOM :: *
29 foreign import document :: {
30 createElement :: String -> DOM
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list