Permalink
Browse files

Deprecate project

  • Loading branch information...
1 parent 5187e2b commit 1298097136b4ab1b60d087109e64f5da812c812f @norm2782 committed Oct 19, 2011
View
2 README
@@ -1 +1 @@
-Haskell Javascript libraries
+This project has been deprecated in favor of the uhc-jscript library
View
18,319 jquery-api-parser/api.xml
0 additions, 18,319 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
69 jquery-api-parser/parse-api.php
@@ -1,69 +0,0 @@
-<?php
-$doc = new DOMDocument();
-$doc->load("api.xml");
-$entries = $doc->getElementsByTagName("entry");
-
-foreach ($entries as $entry) {
- if ($entry->attributes->getNamedItem('type')->value == "method") {
- $funcName = $entry->attributes->getNamedItem('name')->value;
-
- $splitFunc = explode(".", $funcName);
-
- $ffiParts = array();
- $ffiParts[] = "foreign import jscript \"";
-
- $filteredArgs = array();
-
- if (count($splitFunc) > 1) {
- $ns = array_shift($splitFunc);
- $filteredArgs[] = ucfirst($ns);
- } else {
- $filteredArgs[] = "JQuery";
- }
-
- $ffiParts[] = "%1.";
-
- $arguments = $entry->getElementsByTagName("argument");
-
- foreach ($arguments as $argument) {
- if (!isset($filteredArgs[$argument->attributes->getNamedItem('name')->value . $argument->attributes->getNamedItem('type')->value])) {
- $filteredArgs[] = ucfirst($argument->attributes->getNamedItem('type')->value);
- }
- }
-
- $return = ucfirst($entry->attributes->getNamedItem("return")->value);
-
- if (!empty($return)) {
- $filteredArgs[] = $return;
- } else {
- // Or JQuery?
- $filteredArgs[] = "IO ()";
- }
-
- $ffiParts[] = implode($splitFunc, "");
-
- if (count($filteredArgs) > 1) {
- $ffiParts[] = "(%*)\" ";
- } else {
- $ffiParts[] = "()\" ";
- }
-
- $ffiParts[] = implodeUcfirst($splitFunc) . " :: " . implode(" -> ", $filteredArgs);
-
- printFFIParts($ffiParts);
- }
-}
-
-function printFFIParts(array $parts) {
- echo implode("", $parts) . PHP_EOL;
-}
-
-function implodeUcfirst(array $parts) {
- $res = array_shift($parts);
-
- foreach ($parts as $part) {
- $res .= ucfirst($part);
- }
-
- return $res;
-}
View
16 uhc-initial-experiments/JScript.hs
@@ -1,16 +0,0 @@
-module JScript
- ( module JScript.Array
- , module JScript.String
- , module JScript.HTML.DOM
-
- , typeof
- , alert
- )
- where
-
-import JScript.Array
-import JScript.String
-import JScript.HTML.DOM
-
-foreign import jscript "typeof(%*)" typeof :: forall a . a -> JSString
-foreign import jscript alert :: JSString -> IO ()
View
23 uhc-initial-experiments/JScript/Array.hs
@@ -1,23 +0,0 @@
-module JScript.Array
- ( JSArray
- , jsArrayToArray
-
- , lengthJSArray
- , indexJSArray
- )
- where
-
-import UHC.BoxArray
-import UHC.Array
-
-type JSArray x = BoxArray x
-
-foreign import jscript "%1.length" lengthJSArray :: JSArray x -> Int
-
-indexJSArray :: JSArray x -> Int -> x
-indexJSArray = indexArray
-
-jsArrayToArray :: JSArray x -> Array Int x
-jsArrayToArray a
- = Array 0 (l-1) l a
- where l = lengthJSArray a
View
121 uhc-initial-experiments/JScript/HTML/DOM.hs
@@ -1,121 +0,0 @@
-module JScript.HTML.DOM
- ( Document
- , documentAnchors
- , documentForms
- , documentImages
- , documentLinks
- , document
- , documentWriteln, documentWrite
- , documentGetElementById, documentGetElementsByName, documentGetElementsByTagName
-
- , Anchor
- , anchorCharset
- , anchorHref
- , anchorHreflang
- , anchorName
- , anchorRel
- , anchorRev
- , anchorTarget
- , anchorType
-
- , Form
-
- , Image
-
- , Link
-
- , Element
- , elementInnerHTML
- , elementTagName
- , elementClientWidth
- , elementClientHeight
- , elementAttributes
-
- , Attr
- , attrValue
-
- , NamedNodeMap
- , namedNodeMapLength
- , namedNodeMapItem
- , namedNodeMapNamedItem
- , namedNodeMapRemoveNamedItem
- , namedNodeMapSetNamedItem
-
- , Node
- , nodeName
- , nodeType
-
- , NodeList
- , nodeListItem
- , nodeListLength
- )
- where
-
-import JScript.Array
-import JScript.String
-
-data Document
-
-foreign import jscript "document" document :: IO Document
-
-foreign import jscript "%1.anchors" documentAnchors :: Document -> JSArray Anchor
-foreign import jscript "%1.forms" documentForms :: Document -> JSArray Form
-foreign import jscript "%1.images" documentImages :: Document -> JSArray Image
-foreign import jscript "%1.links" documentLinks :: Document -> JSArray Link
-
-foreign import jscript "%1.write(%*)" documentWrite :: Document -> JSString -> IO ()
-foreign import jscript "%1.writeln(%*)" documentWriteln :: Document -> JSString -> IO ()
-
-foreign import jscript "%1.getElementById(%*)" documentGetElementById :: Document -> JSString -> IO Node
-foreign import jscript "%1.getElementsByName(%*)" documentGetElementsByName :: Document -> JSString -> IO (NodeList Node)
-foreign import jscript "%1.getElementsByTagName(%*)" documentGetElementsByTagName :: Document -> JSString -> IO (NodeList Node)
-
-data Anchor
-
-foreign import jscript "%1.charset" anchorCharset :: Anchor -> JSString
-foreign import jscript "%1.href" anchorHref :: Anchor -> JSString
-foreign import jscript "%1.hreflang" anchorHreflang :: Anchor -> JSString
-foreign import jscript "%1.name" anchorName :: Anchor -> JSString
-foreign import jscript "%1.rel" anchorRel :: Anchor -> JSString
-foreign import jscript "%1.rev" anchorRev :: Anchor -> JSString
-foreign import jscript "%1.target" anchorTarget :: Anchor -> JSString
-foreign import jscript "%1.type" anchorType :: Anchor -> JSString
-
-data Form
-
-foreign import jscript "%1.elements" formElements :: Form -> JSArray Element
-
-data Image
-
-data Link
-
-data Element
-
-foreign import jscript "%1.innerHTML" elementInnerHTML :: Node -> JSString
-foreign import jscript "%1.tagName" elementTagName :: Node -> JSString
-foreign import jscript "%1.clientWidth" elementClientWidth :: Node -> Int
-foreign import jscript "%1.clientHeight" elementClientHeight :: Node -> Int
-foreign import jscript "%1.attributes" elementAttributes :: Node -> NamedNodeMap Node
-
-data Node
-
-foreign import jscript "%1.nodeName" nodeName :: Node -> JSString
-foreign import jscript "%1.nodeType" nodeType :: Node -> Int
-
-data NodeList x
-
-foreign import jscript "%1.length" nodeListLength :: NodeList Node -> Int
-foreign import jscript "%1[%2]" nodeListItem :: NodeList Node -> Int -> IO Node
-
-data NamedNodeMap x
-
-foreign import jscript "%1.length" namedNodeMapLength :: NamedNodeMap Node -> Int
-foreign import jscript "%1[%2]" namedNodeMapItem :: NamedNodeMap Node -> Int -> IO Node
-foreign import jscript "%1.getNamedItem(%*)" namedNodeMapNamedItem :: NamedNodeMap Node -> JSString -> IO Node
-foreign import jscript "%1.removeNamedItem(%*)" namedNodeMapRemoveNamedItem :: NamedNodeMap Node -> JSString -> IO Node
-foreign import jscript "%1.setNamedItem(%*)" namedNodeMapSetNamedItem :: NamedNodeMap Node -> Node -> IO Node
-
-data Attr
-
-foreign import jscript "%1.value" attrValue :: Attr -> JSString
-
View
36 uhc-initial-experiments/JScript/JQuery.hs
@@ -1,36 +0,0 @@
-module JScript.JQuery where
-
-import JScript.String
-
-data JQuery
-
-fast = 200
-slow = 600
-
-foreign import jscript "$(%1)" select :: JSString -> IO JQuery
-foreign import jscript "%1.html()" getHTML :: JQuery -> IO JSString
-foreign import jscript "%1.html(%2)" setHTML :: JQuery -> JSString -> IO ()
-foreign import jscript "%1.hide()" hide :: JQuery -> IO ()
-
- -- Or return JQuery for chaining??? Does chaining even make sense?
-foreign import jscript "%1.addClass(%2)" addClass :: JQuery -> JSString -> IO ()
-
---
--- The show() function
---
--- How can functions be passed? Which type should a callback function have?
--- Generally speaking, a callback functions as would be used in show here returns
--- void. What if we make callback functions return ()?
-foreign import jscript "%1.show()" jqshow0 :: JQuery -> IO ()
-foreign import jscript "%1.show(%*)" jqshow1 :: JQuery -> Int -> IO ()
-foreign import jscript "%1.show(%*)" jqshow2 :: JQuery -> Int -> JSString -> IO ()
-foreign import jscript "%1.show(%*)" jqshow2' :: JQuery -> Int -> IO () -> IO ()
-foreign import jscript "%1.show(%*)" jqshow3 :: JQuery -> Int -> JSString -> IO () -> IO ()
-
-jqshow :: JQuery -> Maybe Int -> Maybe String -> Maybe (IO ()) -> IO ()
-jqshow j Nothing Nothing Nothing = jqshow0 j
-jqshow j (Just n) Nothing Nothing = jqshow1 j n
-jqshow j (Just n) (Just e) Nothing = jqshow2 j n (s2js e)
-jqshow j (Just n) Nothing (Just c) = jqshow2' j n c
-jqshow j (Just n) (Just e) (Just c) = jqshow3 j n (s2js e) c
-
View
21 uhc-initial-experiments/JScript/String.hs
@@ -1,21 +0,0 @@
-module JScript.String
- ( JSString
-
- , stringToJSString
- , s2js
- , jsStringToString
- , js2s
- )
- where
-
-type JSString = PackedString
-
-
-foreign import prim "primStringToPackedString" stringToJSString :: String -> JSString
-foreign import prim "primStringToPackedString" s2js :: String -> JSString
-
-jsStringToString :: JSString -> String
-jsStringToString = packedStringToString
-
-js2s :: JSString -> String
-js2s = jsStringToString
View
52 uhc-initial-experiments/Main.hs
@@ -1,52 +0,0 @@
-module Main where
-
-import JScript
-import JScript.JQuery
-
-main :: IO ()
-main = return ()
-
--- Main function
-foreign export jscript "jQueryMain" jQueryMain :: IO ()
-
-jQueryMain :: IO ()
-jQueryMain = do showAlert
- sayHi
- addNeat
- showNeat
-
--- Show an alert
-foreign export jscript "showAlert" showAlert :: IO ()
-
-showAlert :: IO ()
-showAlert = alert $ s2js "Hello, World!"
-
--- Set the contents for to the body element.
-foreign export jscript "sayHi" sayHi :: IO ()
-
-sayHi :: IO ()
-sayHi =
- do j <- select $ s2js "body"
- setHTML j $ s2js "Hi there!"
-
--- Add a (hidden) paragraph to the body element.
-foreign export jscript "addNeat" addNeat :: IO ()
-
-addNeat :: IO ()
-addNeat =
- do j <- select $ s2js "body"
- h <- getHTML j
- setHTML j $ s2js ((js2s h) ++ "<p class='neat'>"
- ++ "<strong>Congratulations!</strong> This awesome "
- ++ "jQuery script has been called by a function you have "
- ++ "written in Haskell!</p>" )
-
--- Show the previously added paragraph using an animation.
-foreign export jscript "showNeat" showNeat :: IO ()
-
-showNeat :: IO ()
-showNeat =
- do j <- select $ s2js "p.neat"
- addClass j $ s2js "ohmy"
- jqshow j (Just slow) Nothing Nothing
-
View
8 uhc-initial-experiments/Makefile
@@ -1,8 +0,0 @@
-default:
- uhc Main.js -tjscript --no-recomp
-
-trace:
- uhc Main.js -tjscript --gen-trace=1 --no-recomp
-
-clean:
- find . -iname "*.hi" -o -iname "*.mjs" -o -iname "*.c" -o -iname "*.grin" -o -iname "*.core" -o -iname "Main.js" | xargs rm
View
58 uhc-initial-experiments/Test.html
@@ -1,58 +0,0 @@
-<!DOCTYPE html><html><head><title>Main</title>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/jscript/libEH-RTS.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Base.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_BoxArray.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Char.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Enum.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Float.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_MutVar.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Read.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_ST.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_STRef.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Show.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_StackTrace.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Types.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Prims.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Ptr.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_ByteArray.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_IOBase.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_OldException.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_OldIO.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Run.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/Generics/UHC_Generics_Tuple.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Generics.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Bounded.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Eq.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Ord.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Ix.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/uhcbase-1.1.2/uhc-1.1.2/jscript/plain/UHC/UHC_Array.mjs"></script>
-<script type="text/javascript" src="/usr/local/lib/uhc-1.1.2/lib/pkg/base-3.0.0.0/uhc-1.1.2/jscript/plain/Prelude.mjs"></script>
-<script type="text/javascript" src="JScript/JScript_Array.mjs"></script>
-<script type="text/javascript" src="JScript/JScript_String.mjs"></script>
-<script type="text/javascript" src="JScript/JScript_JQuery.mjs"></script>
-<script type="text/javascript" src="jquery-1.4.4.js"></script>
-<script type="text/javascript" src="JScript/HTML/JScript_HTML_DOM.mjs"></script>
-<script type="text/javascript" src="JScript.mjs"></script>
-<script type="text/javascript" src="Main.js"></script>
-<script type="text/javascript">
-$(document).ready(jQueryMain);
-</script>
-<style type="text/css">
-body {
- font-family: sans-serif;
-}
-
-p.neat {
- display: none;
- clear: both;
- margin: 1em 0;
- padding: 1em 15px;
- background: #AFAAFF;
- width: 256px;
- border: 1px solid #666666
-}
-</style>
-</head>
-<body>
-</body>
-</html>
View
7,179 uhc-initial-experiments/jquery-1.4.4.js
0 additions, 7,179 deletions not shown because the diff is too large. Please use a local Git client to view these changes.

0 comments on commit 1298097

Please sign in to comment.