-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Since we support compiling singular Pure modules into JavaScript, we have to understand that they might be called from the loosely typed JS environment (they all are).
As of now, a function like
f :: Int -> Int -> String
will compile to
function f(x) {return function(y) {return /* ... */;};}and can be called with arguments of the wrong type
f(false)("hey")We can
- Choose to ignore this and let programmers deal with this themselves;
- Alter the export syntax to automatically include type checks for some functions.
Example:
export (
!f,
otherFunction
);
In this case, the transpiled function f would include type assertions. This would make things a bit more obvious.