Skip to content

Commit 3fbe708

Browse files
committed
Merge pull request #19 from slamdata/refinements
Refinements
2 parents fced384 + e288a67 commit 3fbe708

15 files changed

+765
-707
lines changed

README.md

+34-621
Large diffs are not rendered by default.

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"package.json"
2020
],
2121
"dependencies": {
22-
"purescript-aff": "~0.10.0",
22+
"purescript-aff": "~0.10.1",
2323
"purescript-arraybuffer-types": "~0.1.1",
2424
"purescript-dom": "~0.1.2",
2525
"purescript-foreign": "~0.4.2",

docs/Network.HTTP.Affjax.Request.md

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Module Documentation
2+
3+
## Module Network.HTTP.Affjax.Request
4+
5+
#### `RequestContent`
6+
7+
``` purescript
8+
data RequestContent :: *
9+
```
10+
11+
Type representing all content types that be sent via XHR (ArrayBufferView,
12+
Blob, Document, String, FormData).
13+
14+
#### `Requestable`
15+
16+
``` purescript
17+
class Requestable a where
18+
toRequest :: a -> RequestContent
19+
```
20+
21+
A class for types that can be converted to values that can be sent with
22+
XHR requests.
23+
24+
#### `requestableRequestContent`
25+
26+
``` purescript
27+
instance requestableRequestContent :: Requestable RequestContent
28+
```
29+
30+
31+
#### `requestableInt8Array`
32+
33+
``` purescript
34+
instance requestableInt8Array :: Requestable (A.ArrayView A.Int8)
35+
```
36+
37+
38+
#### `requestableInt16Array`
39+
40+
``` purescript
41+
instance requestableInt16Array :: Requestable (A.ArrayView A.Int16)
42+
```
43+
44+
45+
#### `requestableInt32Array`
46+
47+
``` purescript
48+
instance requestableInt32Array :: Requestable (A.ArrayView A.Int32)
49+
```
50+
51+
52+
#### `requestableUint8Array`
53+
54+
``` purescript
55+
instance requestableUint8Array :: Requestable (A.ArrayView A.Uint8)
56+
```
57+
58+
59+
#### `requestableUint16Array`
60+
61+
``` purescript
62+
instance requestableUint16Array :: Requestable (A.ArrayView A.Uint16)
63+
```
64+
65+
66+
#### `requestableUint32Array`
67+
68+
``` purescript
69+
instance requestableUint32Array :: Requestable (A.ArrayView A.Uint32)
70+
```
71+
72+
73+
#### `requestableUint8ClampedArray`
74+
75+
``` purescript
76+
instance requestableUint8ClampedArray :: Requestable (A.ArrayView A.Uint8Clamped)
77+
```
78+
79+
80+
#### `requestableFloat32Array`
81+
82+
``` purescript
83+
instance requestableFloat32Array :: Requestable (A.ArrayView A.Float32)
84+
```
85+
86+
87+
#### `requestableFloat64Array`
88+
89+
``` purescript
90+
instance requestableFloat64Array :: Requestable (A.ArrayView A.Float64)
91+
```
92+
93+
94+
#### `requestableBlob`
95+
96+
``` purescript
97+
instance requestableBlob :: Requestable Blob
98+
```
99+
100+
101+
#### `requestableDocument`
102+
103+
``` purescript
104+
instance requestableDocument :: Requestable Document
105+
```
106+
107+
108+
#### `requestableString`
109+
110+
``` purescript
111+
instance requestableString :: Requestable String
112+
```
113+
114+
115+
#### `requestableFormData`
116+
117+
``` purescript
118+
instance requestableFormData :: Requestable FormData
119+
```
120+
121+
122+
#### `requestableUnit`
123+
124+
``` purescript
125+
instance requestableUnit :: Requestable Unit
126+
```
127+
128+
129+
130+

docs/Network.HTTP.Affjax.Response.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Module Documentation
2+
3+
## Module Network.HTTP.Affjax.Response
4+
5+
#### `ResponseType`
6+
7+
``` purescript
8+
data ResponseType
9+
```
10+
11+
Valid response types for an AJAX request. This is used to determine the
12+
`ResponseContent` type for a request.
13+
14+
#### `eqResponseType`
15+
16+
``` purescript
17+
instance eqResponseType :: Eq ResponseType
18+
```
19+
20+
21+
#### `showResponseType`
22+
23+
``` purescript
24+
instance showResponseType :: Show ResponseType
25+
```
26+
27+
28+
#### `responseTypeToString`
29+
30+
``` purescript
31+
responseTypeToString :: ResponseType -> String
32+
```
33+
34+
35+
#### `ResponseContent`
36+
37+
``` purescript
38+
type ResponseContent = Foreign
39+
```
40+
41+
Type representing content types that be received from an XHR request
42+
(Blob, Document, JSON, String).
43+
44+
#### `Respondable`
45+
46+
``` purescript
47+
class Respondable a where
48+
responseType :: Proxy a -> ResponseType
49+
fromResponse :: ResponseContent -> F a
50+
```
51+
52+
53+
#### `responsableBlob`
54+
55+
``` purescript
56+
instance responsableBlob :: Respondable Blob
57+
```
58+
59+
60+
#### `responsableDocument`
61+
62+
``` purescript
63+
instance responsableDocument :: Respondable Document
64+
```
65+
66+
67+
#### `responsableJSON`
68+
69+
``` purescript
70+
instance responsableJSON :: Respondable Foreign
71+
```
72+
73+
74+
#### `responsableString`
75+
76+
``` purescript
77+
instance responsableString :: Respondable String
78+
```
79+
80+
81+
#### `responsableUnit`
82+
83+
``` purescript
84+
instance responsableUnit :: Respondable Unit
85+
```
86+
87+
88+
89+

docs/Network.HTTP.Affjax.md

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# Module Documentation
2+
3+
## Module Network.HTTP.Affjax
4+
5+
#### `AJAX`
6+
7+
``` purescript
8+
data AJAX :: !
9+
```
10+
11+
The effect type for AJAX requests made with Affjax.
12+
13+
#### `Affjax`
14+
15+
``` purescript
16+
type Affjax e a = Aff (ajax :: AJAX | e) (AffjaxResponse a)
17+
```
18+
19+
The type for Affjax requests.
20+
21+
#### `AffjaxRequest`
22+
23+
``` purescript
24+
type AffjaxRequest a = { password :: Maybe String, username :: Maybe String, content :: Maybe a, headers :: [RequestHeader], url :: URL, method :: Method }
25+
```
26+
27+
28+
#### `defaultRequest`
29+
30+
``` purescript
31+
defaultRequest :: AffjaxRequest Unit
32+
```
33+
34+
35+
#### `AffjaxResponse`
36+
37+
``` purescript
38+
type AffjaxResponse a = { response :: a, headers :: [ResponseHeader], status :: StatusCode }
39+
```
40+
41+
The type of records that will be received as an Affjax response.
42+
43+
#### `URL`
44+
45+
``` purescript
46+
type URL = String
47+
```
48+
49+
Type alias for URL strings to aid readability of types.
50+
51+
#### `affjax`
52+
53+
``` purescript
54+
affjax :: forall e a b. (Requestable a, Respondable b) => AffjaxRequest a -> Affjax e b
55+
```
56+
57+
Makes an `Affjax` request.
58+
59+
#### `get`
60+
61+
``` purescript
62+
get :: forall e a. (Respondable a) => URL -> Affjax e a
63+
```
64+
65+
Makes a `GET` request to the specified URL.
66+
67+
#### `post`
68+
69+
``` purescript
70+
post :: forall e a b. (Requestable a, Respondable b) => URL -> a -> Affjax e b
71+
```
72+
73+
Makes a `POST` request to the specified URL, sending data.
74+
75+
#### `post'`
76+
77+
``` purescript
78+
post' :: forall e a b. (Requestable a, Respondable b) => URL -> Maybe a -> Affjax e b
79+
```
80+
81+
Makes a `POST` request to the specified URL with the option to send data.
82+
83+
#### `post_`
84+
85+
``` purescript
86+
post_ :: forall e a. (Requestable a) => URL -> a -> Affjax e Unit
87+
```
88+
89+
Makes a `POST` request to the specified URL, sending data and ignoring the
90+
response.
91+
92+
#### `post_'`
93+
94+
``` purescript
95+
post_' :: forall e a. (Requestable a) => URL -> Maybe a -> Affjax e Unit
96+
```
97+
98+
Makes a `POST` request to the specified URL with the option to send data,
99+
and ignores the response.
100+
101+
#### `put`
102+
103+
``` purescript
104+
put :: forall e a b. (Requestable a, Respondable b) => URL -> a -> Affjax e b
105+
```
106+
107+
Makes a `PUT` request to the specified URL, sending data.
108+
109+
#### `put'`
110+
111+
``` purescript
112+
put' :: forall e a b. (Requestable a, Respondable b) => URL -> Maybe a -> Affjax e b
113+
```
114+
115+
Makes a `PUT` request to the specified URL with the option to send data.
116+
117+
#### `put_`
118+
119+
``` purescript
120+
put_ :: forall e a. (Requestable a) => URL -> a -> Affjax e Unit
121+
```
122+
123+
Makes a `PUT` request to the specified URL, sending data and ignoring the
124+
response.
125+
126+
#### `put_'`
127+
128+
``` purescript
129+
put_' :: forall e a. (Requestable a) => URL -> Maybe a -> Affjax e Unit
130+
```
131+
132+
Makes a `PUT` request to the specified URL with the option to send data,
133+
and ignores the response.
134+
135+
#### `delete`
136+
137+
``` purescript
138+
delete :: forall e a. (Respondable a) => URL -> Affjax e a
139+
```
140+
141+
Makes a `DELETE` request to the specified URL.
142+
143+
#### `delete_`
144+
145+
``` purescript
146+
delete_ :: forall e. URL -> Affjax e Unit
147+
```
148+
149+
Makes a `DELETE` request to the specified URL and ignores the response.
150+
151+
#### `affjax'`
152+
153+
``` purescript
154+
affjax' :: forall e a b. (Requestable a, Respondable b) => AffjaxRequest a -> (Error -> Eff (ajax :: AJAX | e) Unit) -> (AffjaxResponse b -> Eff (ajax :: AJAX | e) Unit) -> Eff (ajax :: AJAX | e) (Canceler (ajax :: AJAX | e))
155+
```
156+
157+
Run a request directly without using `Aff`.
158+
159+
160+

0 commit comments

Comments
 (0)