Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 2b5bdd7

Browse files
committed
Merge branch 'master' of github.com:purescript/purescript-maps
Conflicts: .gitignore
2 parents 6ac5833 + 549c37c commit 2b5bdd7

File tree

11 files changed

+127
-130
lines changed

11 files changed

+127
-130
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/output/
2-
/js/
3-
/externs/
4-
/node_modules/
51
/bower_components/
2+
/node_modules/
3+
/output/
64
/tmp/

Gruntfile.js

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,31 @@ module.exports = function(grunt) {
55
grunt.initConfig({
66

77
libFiles: [
8-
"src/**/*.purs.hs",
8+
"src/**/*.purs",
99
"bower_components/purescript-*/src/**/*.purs",
10-
"bower_components/purescript-*/src/**/*.purs.hs"
1110
],
1211

1312
clean: {
14-
tests: ["tmp"],
15-
lib: ["js", "externs"]
13+
lib: ["output"],
14+
tests: ["tmp"]
1615
},
1716

18-
"purescript-make": {
19-
options: {
20-
tco: true,
21-
magicDo: true
22-
},
23-
lib: {
24-
src: "<%=libFiles%>"
25-
}
17+
pscMake: ["<%=libFiles%>"],
18+
dotPsci: ["<%=libFiles%>"],
19+
docgen: {
20+
readme: {
21+
src: "src/**/*.purs",
22+
dest: "README.md"
23+
}
2624
},
27-
28-
purescript: {
25+
26+
psc: {
2927
tests: {
3028
options: {
31-
tco: true,
32-
magicDo: true,
33-
module: ["Main"],
34-
main: true
29+
module: "Tests",
30+
main: "Tests"
3531
},
36-
src: ["tests/tests.purs.hs", "<%=libFiles%>"],
32+
src: ["tests/Tests.purs", "<%=libFiles%>"],
3733
dest: "tmp/tests.js"
3834
}
3935
},
@@ -43,14 +39,14 @@ module.exports = function(grunt) {
4339
src: "tmp/tests.js"
4440
}
4541
}
46-
42+
4743
});
4844

4945
grunt.loadNpmTasks("grunt-contrib-clean");
5046
grunt.loadNpmTasks("grunt-purescript");
5147
grunt.loadNpmTasks("grunt-execute");
5248

53-
grunt.registerTask("test", ["clean:tests", "purescript:tests", "execute:tests"]);
54-
grunt.registerTask("lib", ["purescript-make:lib"]);
55-
grunt.registerTask("default", ["test", "lib"]);
49+
grunt.registerTask("test", ["clean:tests", "psc", "execute"]);
50+
grunt.registerTask("make", ["pscMake", "dotPsci", "docgen"]);
51+
grunt.registerTask("default", ["make", "test"]);
5652
};

README.md

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,86 @@
1-
purescript-maps
2-
===============
1+
# Module Documentation
32

4-
Purely functional maps implemented in PureScript
3+
## Module Data.Graph
4+
5+
### Types
6+
7+
data Edge v where
8+
9+
data Graph v where
10+
11+
12+
### Values
13+
14+
scc :: forall v. (Eq v, Ord v) => Graph v -> [[v]]
15+
16+
topSort :: forall v. (Eq v, Ord v) => Graph v -> [v]
17+
18+
19+
## Module Data.Map
20+
21+
### Types
22+
23+
data Map k v where
24+
25+
26+
### Type Class Instances
27+
28+
instance eqMap :: (P.Eq k, P.Eq v) => P.Eq (Map k v)
29+
30+
instance showMap :: (P.Show k, P.Show v) => P.Show (Map k v)
31+
32+
33+
### Values
34+
35+
alter :: forall k v. (P.Eq k, P.Ord k) => (Maybe v -> Maybe v) -> k -> Map k v -> Map k v
36+
37+
delete :: forall k v. (P.Eq k, P.Ord k) => k -> Map k v -> Map k v
38+
39+
empty :: forall k v. Map k v
40+
41+
fromList :: forall k v. (P.Eq k, P.Ord k) => [Tuple k v] -> Map k v
42+
43+
insert :: forall k v. (P.Eq k, P.Ord k) => k -> v -> Map k v -> Map k v
44+
45+
lookup :: forall k v. (P.Eq k, P.Ord k) => k -> Map k v -> Maybe v
46+
47+
map :: forall k v1 v2. (P.Eq k, P.Ord k) => (v1 -> v2) -> Map k v1 -> Map k v2
48+
49+
singleton :: forall k v. k -> v -> Map k v
50+
51+
toList :: forall k v. Map k v -> [Tuple k v]
52+
53+
union :: forall k v. (P.Eq k, P.Ord k) => Map k v -> Map k v -> Map k v
54+
55+
56+
## Module Data.Set
57+
58+
### Types
59+
60+
data Set a where
61+
62+
63+
### Type Class Instances
64+
65+
instance eqSet :: (P.Eq a) => P.Eq (Set a)
66+
67+
instance showSet :: (P.Show a) => P.Show (Set a)
68+
69+
70+
### Values
71+
72+
delete :: forall a. (P.Eq a, P.Ord a) => a -> Set a -> Set a
73+
74+
empty :: forall a. Set a
75+
76+
fromList :: forall a. (P.Eq a, P.Ord a) => [a] -> Set a
77+
78+
insert :: forall a. (P.Eq a, P.Ord a) => a -> Set a -> Set a
79+
80+
member :: forall a. (P.Eq a, P.Ord a) => a -> Set a -> Prim.Boolean
81+
82+
singleton :: forall a. a -> Set a
83+
84+
toList :: forall a. Set a -> [a]
85+
86+
union :: forall a. (P.Eq a, P.Ord a) => Set a -> Set a -> Set a

bower.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,23 @@
1212
"license": "MIT",
1313
"ignore": [
1414
"**/.*",
15-
"node_modules",
1615
"bower_components",
17-
"externs",
18-
"js",
19-
"tmp"
16+
"node_modules",
17+
"output",
18+
"tests",
19+
"tmp",
20+
"bower.json",
21+
"Gruntfile.js",
22+
"package.json"
2023
],
2124
"devDependencies": {
2225
"purescript-quickcheck": "*"
2326
},
2427
"dependencies": {
2528
"purescript-arrays": "*",
26-
"purescript-maybe": "*",
27-
"purescript-tuples": "*",
29+
"purescript-foldable-traversable": "*",
2830
"purescript-math": "*",
29-
"purescript-foldable-traversable": "*"
31+
"purescript-maybe": "*",
32+
"purescript-tuples": "*"
3033
}
3134
}

docs/Map.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

docs/Set.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
{
2-
"name": "purescript-maps",
3-
"version": "0.0.0",
4-
"repository": {
5-
"type": "git",
6-
"url": "https://github.com/purescript/purescript-maps.git"
7-
},
8-
"devDependencies": {
9-
"grunt-purescript": "~0.4.0",
10-
"grunt-execute": "~0.1.5",
11-
"grunt-contrib-clean": "~0.5.0"
2+
"private": true,
3+
"dependencies": {
4+
"grunt": "~0.4.4",
5+
"grunt-purescript": "~0.5.1",
6+
"grunt-contrib-clean": "~0.5.0",
7+
"grunt-execute": "~0.2.1"
128
}
139
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)