Skip to content

Commit

Permalink
Updates for RC
Browse files Browse the repository at this point in the history
  • Loading branch information
garyb committed Jun 6, 2015
1 parent 88114ef commit 1aeaf39
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 40 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/.*
!/.gitignore
!/.jscsrc
!/.jshintrc
!/.travis.yml
/bower_components/
/node_modules/
/output/
/tmp/
12 changes: 12 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"preset": "grunt",
"disallowSpacesInAnonymousFunctionExpression": null,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInsideObjectBrackets": null,
"requireSpacesInsideObjectBrackets": "all",
"validateQuoteMarks": "\"",
"requireCurlyBraces": null
}
19 changes: 19 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"bitwise": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"funcscope": true,
"futurehostile": true,
"globalstrict": true,
"latedef": true,
"maxparams": 1,
"noarg": true,
"nocomma": true,
"nonew": true,
"notypeof": true,
"singleGroups": true,
"undef": true,
"unused": true,
"eqnull": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

## Installation

Expand Down
12 changes: 6 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "purescript-arrays",
"homepage": "https://github.com/purescript/purescript-arrays",
"description": "Instances and utility functions for arrays",
"description": "Array utility functions",
"keywords": [
"purescript"
],
Expand All @@ -16,12 +16,12 @@
"package.json"
],
"dependencies": {
"purescript-foldable-traversable": "~0.4.0",
"purescript-st": "~0.1.0",
"purescript-tuples": "~0.4.0"
"purescript-foldable-traversable": "^0.4.0",
"purescript-st": "^0.1.0",
"purescript-tuples": "^0.4.0"
},
"devDependencies": {
"purescript-assert": "~0.1.0",
"purescript-console": "~0.1.0"
"purescript-assert": "^0.1.0",
"purescript-console": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"gulp-jscs": "^1.6.0",
"gulp-jshint": "^1.10.0",
"gulp-plumber": "^1.0.0",
"gulp-purescript": "^0.5.0",
"gulp-purescript": "^0.5.0-rc.1",
"gulp-run": "~1.6.7",
"rimraf": "^2.3.3"
}
Expand Down
30 changes: 2 additions & 28 deletions src/Data/Array.purs
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ module Data.Array
, foldM
) where

import Prelude
import Control.Alt (Alt, (<|>))
import Control.Alternative (Alternative)
import Control.Lazy (Lazy, defer)
import Control.MonadPlus (MonadPlus)
import Control.Plus (Plus)
import Data.Foldable (Foldable, foldr)
import Data.Functor.Invariant (Invariant, imapF)
import Data.Maybe (Maybe(..), maybe, isJust)
import Data.Monoid (Monoid, mempty)
import Data.Traversable (Traversable, traverse, sequence)
import Data.Traversable (sequence)
import Data.Tuple (Tuple(..))

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

foreign import foldlArray :: forall a b. (b -> a -> b) -> b -> Array a -> b

--------------------------------------------------------------------------------
-- Non-Prelude instances -------------------------------------------------------
--------------------------------------------------------------------------------

instance altArray :: Alt Array where
alt = append

instance plusArray :: Plus Array where
empty = []

instance alternativeArray :: Alternative Array

instance monadPlusArray :: MonadPlus Array

instance foldableArray :: Foldable Array where
foldr f z xs = foldrArray f z xs
foldl f z xs = foldlArray f z xs
foldMap f xs = foldr (\x acc -> f x <> acc) mempty xs

instance traversableArray :: Traversable Array where
traverse f = uncons' (\_ -> pure []) (\x xs -> (:) <$> (f x) <*> traverse f xs)
sequence = uncons' (\_ -> pure []) (\x xs -> (:) <$> x <*> sequence xs)

instance invariantArray :: Invariant Array where
imap = imapF
1 change: 1 addition & 0 deletions src/Data/Array/ST.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Data.Array.ST
, toAssocArray
) where

import Prelude
import Control.Monad.Eff (Eff())
import Control.Monad.ST (ST())
import Data.Maybe (Maybe(..))
Expand Down
1 change: 1 addition & 0 deletions src/Data/Array/Unsafe.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

module Data.Array.Unsafe where

import Prelude
import Data.Array (length, slice)

-- | Find the element of an array at the specified index.
Expand Down
3 changes: 2 additions & 1 deletion test/Test/Data/Array.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Test.Data.Array (testArray) where

import Console (log)
import Prelude
import Control.Monad.Eff.Console (log)
import Data.Array
import Data.Maybe (Maybe(..), isNothing)
import Data.Maybe.Unsafe (fromJust)
Expand Down
3 changes: 2 additions & 1 deletion test/Test/Data/Array/ST.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Test.Data.Array.ST (testArrayST) where

import Console (log, print)
import Prelude
import Control.Monad.Eff.Console (log, print)
import Control.Monad.Eff (runPure)
import Control.Monad.ST (runST)
import Data.Array ()
Expand Down
3 changes: 2 additions & 1 deletion test/Test/Data/Array/Unsafe.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Test.Data.Array.Unsafe (testArrayUnsafe) where

import Console (log)
import Prelude
import Control.Monad.Eff.Console (log)
import Data.Array.Unsafe
import Test.Assert (assert)

Expand Down
1 change: 1 addition & 0 deletions test/Test/Main.purs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Test.Main where

import Prelude
import Test.Data.Array
import Test.Data.Array.ST
import Test.Data.Array.Unsafe
Expand Down

0 comments on commit 1aeaf39

Please sign in to comment.