Skip to content

Commit 46f1116

Browse files
author
Mike Solomon
committed
Initial commit
0 parents  commit 46f1116

22 files changed

+1322
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# purescript-web-dom.py
2+
3+
A port of web-dom to purescript-python

packages.dhall

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{-
2+
Welcome to your new Dhall package-set!
3+
4+
Below are instructions for how to edit this file for most use
5+
cases, so that you don't need to know Dhall to use it.
6+
7+
## Warning: Don't Move This Top-Level Comment!
8+
9+
Due to how `dhall format` currently works, this comment's
10+
instructions cannot appear near corresponding sections below
11+
because `dhall format` will delete the comment. However,
12+
it will not delete a top-level comment like this one.
13+
14+
## Use Cases
15+
16+
Most will want to do one or both of these options:
17+
1. Override/Patch a package's dependency
18+
2. Add a package not already in the default package set
19+
20+
This file will continue to work whether you use one or both options.
21+
Instructions for each option are explained below.
22+
23+
### Overriding/Patching a package
24+
25+
Purpose:
26+
- Change a package's dependency to a newer/older release than the
27+
default package set's release
28+
- Use your own modified version of some dependency that may
29+
include new API, changed API, removed API by
30+
using your custom git repo of the library rather than
31+
the package set's repo
32+
33+
Syntax:
34+
Replace the overrides' "{=}" (an empty record) with the following idea
35+
The "//" or "⫽" means "merge these two records and
36+
when they have the same value, use the one on the right:"
37+
-------------------------------
38+
let overrides =
39+
{ packageName =
40+
upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" }
41+
, packageName =
42+
upstream.packageName // { version = "v4.0.0" }
43+
, packageName =
44+
upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" }
45+
}
46+
-------------------------------
47+
48+
Example:
49+
-------------------------------
50+
let overrides =
51+
{ halogen =
52+
upstream.halogen // { version = "master" }
53+
, halogen-vdom =
54+
upstream.halogen-vdom // { version = "v4.0.0" }
55+
}
56+
-------------------------------
57+
58+
### Additions
59+
60+
Purpose:
61+
- Add packages that aren't already included in the default package set
62+
63+
Syntax:
64+
Replace the additions' "{=}" (an empty record) with the following idea:
65+
-------------------------------
66+
let additions =
67+
{ package-name =
68+
{ dependencies =
69+
[ "dependency1"
70+
, "dependency2"
71+
]
72+
, repo =
73+
"https://example.com/path/to/git/repo.git"
74+
, version =
75+
"tag ('v4.0.0') or branch ('master')"
76+
}
77+
, package-name =
78+
{ dependencies =
79+
[ "dependency1"
80+
, "dependency2"
81+
]
82+
, repo =
83+
"https://example.com/path/to/git/repo.git"
84+
, version =
85+
"tag ('v4.0.0') or branch ('master')"
86+
}
87+
, etc.
88+
}
89+
-------------------------------
90+
91+
Example:
92+
-------------------------------
93+
let additions =
94+
{ benchotron =
95+
{ dependencies =
96+
[ "arrays"
97+
, "exists"
98+
, "profunctor"
99+
, "strings"
100+
, "quickcheck"
101+
, "lcg"
102+
, "transformers"
103+
, "foldable-traversable"
104+
, "exceptions"
105+
, "node-fs"
106+
, "node-buffer"
107+
, "node-readline"
108+
, "datetime"
109+
, "now"
110+
]
111+
, repo =
112+
"https://github.com/hdgarrood/purescript-benchotron.git"
113+
, version =
114+
"v7.0.0"
115+
}
116+
}
117+
-------------------------------
118+
-}
119+
120+
121+
let upstream =
122+
https://github.com/purescript/package-sets/releases/download/psc-0.13.8/packages.dhall sha256:0e95ec11604dc8afc1b129c4d405dcc17290ce56d7d0665a0ff15617e32bbf03
123+
124+
let overrides = {=}
125+
126+
let additions = {=}
127+
128+
in upstream // overrides // additions

pure-py.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"corefn-dir": "output",
3+
"data-format": "Compressed",
4+
"entry-module": "Main",
5+
"index-mirror": "affexpr",
6+
"pspy-blueprint": "pspy-blueprint"
7+
}

python-ffi/Web/DOM/CharacterData.py

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import xml.dom
2+
import xml.dom.minidom
3+
4+
5+
def data_(t: xml.dom.minidom.CharacterData):
6+
def _1():
7+
return t.data
8+
9+
return _1
10+
11+
12+
def length(t: xml.dom.minidom.CharacterData):
13+
def _1():
14+
return len(t.data)
15+
16+
return _1
17+
18+
19+
def substringData(offset):
20+
def _1(count):
21+
def _2(cd: xml.dom.minidom.CharacterData):
22+
def _3():
23+
return cd.substringData(offset, count)
24+
25+
return _3
26+
27+
return _2
28+
29+
return _1
30+
31+
32+
def appendData(data):
33+
def _1(cd: xml.dom.minidom.CharacterData):
34+
def _2():
35+
return cd.appendData(data)
36+
37+
return _2
38+
39+
return _1
40+
41+
42+
def insertData(offset):
43+
def _1(data):
44+
def _2(cd: xml.dom.minidom.CharacterData):
45+
def _3():
46+
return cd.insertData(offset, data)
47+
48+
return _3
49+
50+
return _2
51+
52+
return _1
53+
54+
55+
def deleteData(offset):
56+
def _1(count):
57+
def _2(cd: xml.dom.minidom.CharacterData):
58+
def _3():
59+
cd.deleteData(offset, count)
60+
61+
return _3
62+
63+
return _2
64+
65+
return _1
66+
67+
68+
def replaceData(offset):
69+
def _1(count):
70+
def _2(data):
71+
def _3(cd: xml.dom.minidom.CharacterData):
72+
def _4():
73+
cd.replaceData(offset, count, data)
74+
75+
return _4
76+
77+
return _3
78+
79+
return _2
80+
81+
return _1
82+

python-ffi/Web/DOM/ChildNode.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import xml.dom.minidom
2+
3+
4+
def remove(node: xml.dom.minidom.Node):
5+
def _1():
6+
return node.parentNode.removeChild(node)
7+
8+
return _1
9+

python-ffi/Web/DOM/DOMTokenList.py

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import xml.dom.minidom
2+
3+
4+
def add(l: list):
5+
def _1(token):
6+
def _2():
7+
return l.append(token)
8+
9+
return _2
10+
11+
return _1
12+
13+
14+
def remove(l: list):
15+
def _1(token):
16+
def _2():
17+
return l.remove(token)
18+
19+
return _2
20+
21+
return _1
22+
23+
24+
def contains(l: list):
25+
def _1(token):
26+
def _2():
27+
return token in l
28+
29+
return _2
30+
31+
return _1
32+
33+
34+
def toggle(l: list):
35+
def _1(token):
36+
def _2():
37+
if token in l:
38+
l.remove(token)
39+
return False
40+
l.append(token)
41+
return True
42+
43+
return _2
44+
45+
return _1
46+
47+
48+
def toggleForce(l: list):
49+
def _1(token):
50+
def _2(force):
51+
def _3():
52+
if not force and (token in l):
53+
l.remove(token)
54+
elif force and (token not in l):
55+
l.append(token)
56+
return force
57+
58+
return _3
59+
60+
return _2
61+
62+
return _1
63+
64+
65+
def _item(l: list):
66+
def _1(idx):
67+
def _2():
68+
return l[idx]
69+
70+
return _2
71+
72+
return _1

0 commit comments

Comments
 (0)