forked from norm2782/uhc-jscript
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some jugling with module and JS functions
- Loading branch information
Showing
3 changed files
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
module Language.UHC.JScript.Assorted where | ||
|
||
import Language.UHC.JScript.ECMA.String | ||
import Language.UHC.JScript.Types | ||
import Language.UHC.JScript.Primitives | ||
|
||
foreign import jscript "alert(%*)" | ||
alert :: JSString -> IO () | ||
alert :: String -> IO () | ||
alert = _alert . toJS | ||
|
||
foreign import jscript "alert(%*)" | ||
_alert :: JSString -> IO () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
module Language.UHC.JScript.ECMA.Expressions where | ||
|
||
foreign import jscript "typeof(%*)" | ||
typeof :: a -> JSString | ||
import Language.UHC.JScript.ECMA.String | ||
import Language.UHC.JScript.Types | ||
import Language.UHC.JScript.Primitives | ||
|
||
typeof :: a -> String | ||
typeof = fromJS . _typeof | ||
|
||
foreign import jscript "typeof(%*)" | ||
_typeof :: a -> JSString |