Skip to content

Commit 15366c4

Browse files
committed
Merge pull request #60 from jonsterling/update-build
Update build, fix warnings
2 parents 396b0f9 + 446eca4 commit 15366c4

10 files changed

+51
-47
lines changed

docs/Network.HTTP.Affjax.Request.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Blob, Document, String, FormData).
1111

1212
##### Instances
1313
``` purescript
14-
instance requestableRequestContent :: Requestable RequestContent
14+
Requestable RequestContent
1515
```
1616

1717
#### `Requestable`
@@ -27,22 +27,22 @@ XHR requests. An optional mime-type can be specified for a default
2727

2828
##### Instances
2929
``` purescript
30-
instance requestableRequestContent :: Requestable RequestContent
31-
instance requestableInt8Array :: Requestable (ArrayView Int8)
32-
instance requestableInt16Array :: Requestable (ArrayView Int16)
33-
instance requestableInt32Array :: Requestable (ArrayView Int32)
34-
instance requestableUint8Array :: Requestable (ArrayView Uint8)
35-
instance requestableUint16Array :: Requestable (ArrayView Uint16)
36-
instance requestableUint32Array :: Requestable (ArrayView Uint32)
37-
instance requestableUint8ClampedArray :: Requestable (ArrayView Uint8Clamped)
38-
instance requestableFloat32Array :: Requestable (ArrayView Float32)
39-
instance requestableFloat64Array :: Requestable (ArrayView Float64)
40-
instance requestableBlob :: Requestable Blob
41-
instance requestableDocument :: Requestable Document
42-
instance requestableString :: Requestable String
43-
instance requestableJson :: Requestable Json
44-
instance requestableFormData :: Requestable FormData
45-
instance requestableUnit :: Requestable Unit
30+
Requestable RequestContent
31+
Requestable (ArrayView Int8)
32+
Requestable (ArrayView Int16)
33+
Requestable (ArrayView Int32)
34+
Requestable (ArrayView Uint8)
35+
Requestable (ArrayView Uint16)
36+
Requestable (ArrayView Uint32)
37+
Requestable (ArrayView Uint8Clamped)
38+
Requestable (ArrayView Float32)
39+
Requestable (ArrayView Float64)
40+
Requestable Blob
41+
Requestable Document
42+
Requestable String
43+
Requestable Json
44+
Requestable FormData
45+
Requestable Unit
4646
```
4747

4848

docs/Network.HTTP.Affjax.Response.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ type used to associate the `ResponseType` with a particular instance of
1818

1919
##### Instances
2020
``` purescript
21-
instance eqResponseType :: Eq (ResponseType a)
22-
instance showResponseType :: Show (ResponseType a)
21+
Eq (ResponseType a)
22+
Show (ResponseType a)
2323
```
2424

2525
#### `responseTypeToString`
@@ -48,13 +48,13 @@ class Respondable a where
4848

4949
##### Instances
5050
``` purescript
51-
instance responsableBlob :: Respondable Blob
52-
instance responsableDocument :: Respondable Document
53-
instance responsableForeign :: Respondable Foreign
54-
instance responsableString :: Respondable String
55-
instance responsableUnit :: Respondable Unit
56-
instance responsableArrayBuffer :: Respondable ArrayBuffer
57-
instance responsableJson :: Respondable Json
51+
Respondable Blob
52+
Respondable Document
53+
Respondable Foreign
54+
Respondable String
55+
Respondable Unit
56+
Respondable ArrayBuffer
57+
Respondable Json
5858
```
5959

6060

docs/Network.HTTP.Method.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ data Method
1818

1919
##### Instances
2020
``` purescript
21-
instance eqMethod :: Eq Method
22-
instance showMethod :: Show Method
21+
Eq Method
22+
Show Method
2323
```
2424

2525
#### `methodToString`

docs/Network.HTTP.MimeType.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ newtype MimeType
99

1010
##### Instances
1111
``` purescript
12-
instance eqMimeType :: Eq MimeType
13-
instance showMimeType :: Show MimeType
12+
Eq MimeType
13+
Show MimeType
1414
```
1515

1616
#### `mimeTypeToString`

docs/Network.HTTP.RequestHeader.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ data RequestHeader
1111

1212
##### Instances
1313
``` purescript
14-
instance eqRequestHeader :: Eq RequestHeader
15-
instance showRequestHeader :: Show RequestHeader
14+
Eq RequestHeader
15+
Show RequestHeader
1616
```
1717

1818
#### `requestHeaderName`

docs/Network.HTTP.ResponseHeader.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ data ResponseHeader
88

99
##### Instances
1010
``` purescript
11-
instance eqResponseHeader :: Eq ResponseHeader
12-
instance showResponseHeader :: Show ResponseHeader
11+
Eq ResponseHeader
12+
Show ResponseHeader
1313
```
1414

1515
#### `responseHeader`

docs/Network.HTTP.StatusCode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ newtype StatusCode
99

1010
##### Instances
1111
``` purescript
12-
instance eqStatusCode :: Eq StatusCode
13-
instance showStatusCode :: Show StatusCode
12+
Eq StatusCode
13+
Show StatusCode
1414
```
1515

1616

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"gulp-jscs": "^1.6.0",
88
"gulp-jshint": "^1.11.2",
99
"gulp-plumber": "^1.0.0",
10-
"gulp-purescript": "^0.6.0",
11-
"purescript": "^0.7.5",
10+
"gulp-purescript": "^0.8.0",
11+
"purescript": "^0.7.6",
1212
"xhr2": "^0.1.3"
1313
}
1414
}

src/Network/HTTP/Affjax/Response.purs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ module Network.HTTP.Affjax.Response
66

77
import Prelude
88

9-
import Control.Bind ((<=<))
10-
119
import Data.Argonaut.Core (Json())
1210
import Data.Either (Either(..))
13-
import Data.Foreign (Foreign(), F(), parseJSON, readString, unsafeReadTagged)
11+
import Data.Foreign (Foreign(), F(), readString, unsafeReadTagged)
1412
import Data.Maybe (Maybe(..))
1513
import Data.Tuple (Tuple(..))
1614
import qualified Data.ArrayBuffer.Types as A

test/Main.purs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@ module Test.Main where
33
import Prelude
44

55
import Control.Monad.Aff
6+
import Control.Monad.Aff.AVar (AVAR())
67
import Control.Bind
78
import Control.Monad.Eff
89
import Control.Monad.Eff.Class
10+
import Control.Monad.Eff.Ref (REF())
911
import Control.Monad.Eff.Console (CONSOLE(), log, print)
1012
import qualified Control.Monad.Aff.Console as A
1113
import Control.Monad.Eff.Exception
1214
import Data.Either
1315
import Data.Maybe
1416
import Data.Foreign
1517
import Network.HTTP.Affjax
16-
import Network.HTTP.Affjax.Response
17-
import Network.HTTP.Affjax.Request
18-
import Network.HTTP.Method
19-
import Network.HTTP.MimeType.Common
20-
import Network.HTTP.RequestHeader
2118
import Network.HTTP.StatusCode
2219

2320
foreign import logAny
@@ -55,6 +52,15 @@ assertEq x y = if x == y
5552
typeIs :: forall e a. a -> Assert e Unit
5653
typeIs = const (return unit)
5754

55+
type MainEffects e =
56+
( ref :: REF
57+
, avar :: AVAR
58+
, err :: EXCEPTION
59+
, console :: CONSOLE
60+
| e
61+
)
62+
63+
main :: Eff (MainEffects (ajax :: AJAX)) Unit
5864
main = runAff (\e -> print e >>= \_ -> throwException e) (const $ log "affjax: All good!") $ do
5965
let ok200 = StatusCode 200
6066
let notFound404 = StatusCode 404
@@ -82,7 +88,7 @@ main = runAff (\e -> print e >>= \_ -> throwException e) (const $ log "affjax: A
8288
assertEq notFound404 res.status
8389

8490
A.log "GET /not-json: invalid JSON with Foreign response should throw an error"
85-
assertLeft =<< attempt (get doesNotExist :: Affjax _ Foreign)
91+
assertLeft =<< attempt (get doesNotExist :: Affjax (MainEffects ()) Foreign)
8692

8793
A.log "GET /not-json: invalid JSON with String response should be ok"
8894
(attempt $ get notJson) >>= assertRight >>= \res -> do

0 commit comments

Comments
 (0)