Skip to content

Commit 1aeaf39

Browse files
committed
Updates for RC
1 parent 88114ef commit 1aeaf39

File tree

13 files changed

+52
-40
lines changed

13 files changed

+52
-40
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/.*
22
!/.gitignore
3+
!/.jscsrc
4+
!/.jshintrc
35
!/.travis.yml
46
/bower_components/
57
/node_modules/
68
/output/
7-
/tmp/

.jscsrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"preset": "grunt",
3+
"disallowSpacesInAnonymousFunctionExpression": null,
4+
"requireSpacesInAnonymousFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
8+
"disallowSpacesInsideObjectBrackets": null,
9+
"requireSpacesInsideObjectBrackets": "all",
10+
"validateQuoteMarks": "\"",
11+
"requireCurlyBraces": null
12+
}

.jshintrc

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"bitwise": true,
3+
"eqeqeq": true,
4+
"forin": true,
5+
"freeze": true,
6+
"funcscope": true,
7+
"futurehostile": true,
8+
"globalstrict": true,
9+
"latedef": true,
10+
"maxparams": 1,
11+
"noarg": true,
12+
"nocomma": true,
13+
"nonew": true,
14+
"notypeof": true,
15+
"singleGroups": true,
16+
"undef": true,
17+
"unused": true,
18+
"eqnull": true
19+
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://travis-ci.org/purescript/purescript-arrays.svg?branch=master)](https://travis-ci.org/purescript/purescript-arrays)
44

5-
Instances and utility functions for the `Array` type - JavaScript's native arrays.
5+
Utility functions for the `Array` type - JavaScript's native arrays.
66

77
## Installation
88

bower.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "purescript-arrays",
33
"homepage": "https://github.com/purescript/purescript-arrays",
4-
"description": "Instances and utility functions for arrays",
4+
"description": "Array utility functions",
55
"keywords": [
66
"purescript"
77
],
@@ -16,12 +16,12 @@
1616
"package.json"
1717
],
1818
"dependencies": {
19-
"purescript-foldable-traversable": "~0.4.0",
20-
"purescript-st": "~0.1.0",
21-
"purescript-tuples": "~0.4.0"
19+
"purescript-foldable-traversable": "^0.4.0",
20+
"purescript-st": "^0.1.0",
21+
"purescript-tuples": "^0.4.0"
2222
},
2323
"devDependencies": {
24-
"purescript-assert": "~0.1.0",
25-
"purescript-console": "~0.1.0"
24+
"purescript-assert": "^0.1.0",
25+
"purescript-console": "^0.1.0"
2626
}
2727
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"gulp-jscs": "^1.6.0",
99
"gulp-jshint": "^1.10.0",
1010
"gulp-plumber": "^1.0.0",
11-
"gulp-purescript": "^0.5.0",
11+
"gulp-purescript": "^0.5.0-rc.1",
1212
"gulp-run": "~1.6.7",
1313
"rimraf": "^2.3.3"
1414
}

src/Data/Array.purs

+2-28
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ module Data.Array
7373
, foldM
7474
) where
7575

76+
import Prelude
7677
import Control.Alt (Alt, (<|>))
7778
import Control.Alternative (Alternative)
7879
import Control.Lazy (Lazy, defer)
7980
import Control.MonadPlus (MonadPlus)
8081
import Control.Plus (Plus)
81-
import Data.Foldable (Foldable, foldr)
8282
import Data.Functor.Invariant (Invariant, imapF)
8383
import Data.Maybe (Maybe(..), maybe, isJust)
8484
import Data.Monoid (Monoid, mempty)
85-
import Data.Traversable (Traversable, traverse, sequence)
85+
import Data.Traversable (sequence)
8686
import Data.Tuple (Tuple(..))
8787

8888
--------------------------------------------------------------------------------
@@ -481,29 +481,3 @@ foldM f a = uncons' (\_ -> return a) (\b bs -> f a b >>= \a' -> foldM f a' bs)
481481
foreign import foldrArray :: forall a b. (a -> b -> b) -> b -> Array a -> b
482482

483483
foreign import foldlArray :: forall a b. (b -> a -> b) -> b -> Array a -> b
484-
485-
--------------------------------------------------------------------------------
486-
-- Non-Prelude instances -------------------------------------------------------
487-
--------------------------------------------------------------------------------
488-
489-
instance altArray :: Alt Array where
490-
alt = append
491-
492-
instance plusArray :: Plus Array where
493-
empty = []
494-
495-
instance alternativeArray :: Alternative Array
496-
497-
instance monadPlusArray :: MonadPlus Array
498-
499-
instance foldableArray :: Foldable Array where
500-
foldr f z xs = foldrArray f z xs
501-
foldl f z xs = foldlArray f z xs
502-
foldMap f xs = foldr (\x acc -> f x <> acc) mempty xs
503-
504-
instance traversableArray :: Traversable Array where
505-
traverse f = uncons' (\_ -> pure []) (\x xs -> (:) <$> (f x) <*> traverse f xs)
506-
sequence = uncons' (\_ -> pure []) (\x xs -> (:) <$> x <*> sequence xs)
507-
508-
instance invariantArray :: Invariant Array where
509-
imap = imapF

src/Data/Array/ST.purs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module Data.Array.ST
1616
, toAssocArray
1717
) where
1818

19+
import Prelude
1920
import Control.Monad.Eff (Eff())
2021
import Control.Monad.ST (ST())
2122
import Data.Maybe (Maybe(..))

src/Data/Array/Unsafe.purs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
module Data.Array.Unsafe where
77

8+
import Prelude
89
import Data.Array (length, slice)
910

1011
-- | Find the element of an array at the specified index.

test/Test/Data/Array.purs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Test.Data.Array (testArray) where
22

3-
import Console (log)
3+
import Prelude
4+
import Control.Monad.Eff.Console (log)
45
import Data.Array
56
import Data.Maybe (Maybe(..), isNothing)
67
import Data.Maybe.Unsafe (fromJust)

test/Test/Data/Array/ST.purs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Test.Data.Array.ST (testArrayST) where
22

3-
import Console (log, print)
3+
import Prelude
4+
import Control.Monad.Eff.Console (log, print)
45
import Control.Monad.Eff (runPure)
56
import Control.Monad.ST (runST)
67
import Data.Array ()

test/Test/Data/Array/Unsafe.purs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Test.Data.Array.Unsafe (testArrayUnsafe) where
22

3-
import Console (log)
3+
import Prelude
4+
import Control.Monad.Eff.Console (log)
45
import Data.Array.Unsafe
56
import Test.Assert (assert)
67

test/Test/Main.purs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Test.Main where
22

3+
import Prelude
34
import Test.Data.Array
45
import Test.Data.Array.ST
56
import Test.Data.Array.Unsafe

0 commit comments

Comments
 (0)