Skip to content

Prepare for 2.0 release #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Prepare for 2.0 release
  • Loading branch information
garyb committed Oct 7, 2016
commit ec16bf6a6ab09f0390d4ab18105208b594772fb5
12 changes: 6 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"package.json"
],
"dependencies": {
"purescript-foldable-traversable": "^1.0.0",
"purescript-foldable-traversable": "^2.0.0",
"purescript-partial": "^1.1.0",
"purescript-st": "^1.0.0",
"purescript-tuples": "^1.0.0",
"purescript-unfoldable": "^1.0.0"
"purescript-st": "^2.0.0",
"purescript-tuples": "^3.0.0",
"purescript-unfoldable": "^2.0.0"
},
"devDependencies": {
"purescript-assert": "^1.0.0",
"purescript-console": "^1.0.0"
"purescript-assert": "^2.0.0",
"purescript-console": "^2.0.0"
}
}
3 changes: 0 additions & 3 deletions src/Data/Array.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* global exports */
"use strict";

// module Data.Array

//------------------------------------------------------------------------------
// Array creation --------------------------------------------------------------
//------------------------------------------------------------------------------
Expand Down
21 changes: 14 additions & 7 deletions src/Data/Array.purs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ module Data.Array
, unzip

, foldM

, module Exports
) where

import Prelude
Expand All @@ -109,7 +111,9 @@ import Control.Alternative (class Alternative)
import Control.Lazy (class Lazy, defer)

import Data.Foldable (class Foldable, foldl, foldr)
import Data.Foldable (foldl, foldr, foldMap, fold, intercalate, elem, notElem, find, findMap, any, all) as Exports
import Data.Maybe (Maybe(..), maybe, isJust, fromJust)
import Data.Traversable (scanl, scanr) as Exports
import Data.Traversable (sequence)
import Data.Tuple (Tuple(..))
import Data.Unfoldable (class Unfoldable, unfoldr)
Expand Down Expand Up @@ -214,13 +218,15 @@ head = uncons' (const Nothing) (\x _ -> Just x)
last :: forall a. Array a -> Maybe a
last xs = xs !! (length xs - 1)

-- | Get all but the first element of an array, creating a new array, or `Nothing` if the array is empty
-- | Get all but the first element of an array, creating a new array, or
-- | `Nothing` if the array is empty
-- |
-- | Running time: `O(n)` where `n` is the length of the array
tail :: forall a. Array a -> Maybe (Array a)
tail = uncons' (const Nothing) (\_ xs -> Just xs)

-- | Get all but the last element of an array, creating a new array, or `Nothing` if the array is empty.
-- | Get all but the last element of an array, creating a new array, or
-- | `Nothing` if the array is empty.
-- |
-- | Running time: `O(n)` where `n` is the length of the array
init :: forall a. Array a -> Maybe (Array a)
Expand Down Expand Up @@ -428,8 +434,8 @@ mapWithIndex f xs =
sort :: forall a. Ord a => Array a -> Array a
sort xs = sortBy compare xs

-- | Sort the elements of an array in increasing order, where elements are compared using
-- | the specified partial ordering, creating a new array.
-- | Sort the elements of an array in increasing order, where elements are
-- | compared using the specified partial ordering, creating a new array.
sortBy :: forall a. (a -> a -> Ordering) -> Array a -> Array a
sortBy comp xs = sortImpl comp' xs
where
Expand Down Expand Up @@ -590,8 +596,8 @@ foreign import zipWith
-> Array b
-> Array c

-- | A generalization of `zipWith` which accumulates results in some `Applicative`
-- | functor.
-- | A generalization of `zipWith` which accumulates results in some
-- | `Applicative` functor.
zipWithA
:: forall m a b c
. Applicative m
Expand All @@ -602,7 +608,8 @@ zipWithA
zipWithA f xs ys = sequence (zipWith f xs ys)

-- | Rakes two lists and returns a list of corresponding pairs.
-- | If one input list is short, excess elements of the longer list are discarded.
-- | If one input list is short, excess elements of the longer list are
-- | discarded.
zip :: forall a b. Array a -> Array b -> Array (Tuple a b)
zip = zipWith Tuple

Expand Down
3 changes: 0 additions & 3 deletions src/Data/Array/Partial.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* global exports */
"use strict";

// module Data.Array.Partial

exports.unsafeIndexImpl = function (xs) {
return function (n) {
return xs[n];
Expand Down
3 changes: 0 additions & 3 deletions src/Data/Array/ST.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* global exports */
"use strict";

// module Data.Array.ST

exports.runSTArray = function (f) {
return f;
};
Expand Down