Skip to content

Commit

Permalink
compiled docs
Browse files Browse the repository at this point in the history
  • Loading branch information
raichoo committed Feb 27, 2016
1 parent 342b89e commit bf7dd08
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/Data/Array.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ termination.
null :: forall a. Array a -> Boolean
```

Test whether an array is empty.

#### `length`

``` purescript
Expand All @@ -115,6 +117,14 @@ Get the number of elements in an array.
cons :: forall a. a -> Array a -> Array a
```

Attaches an element to the front of an array, creating a new array.

```purescript
cons 1 [2, 3, 4] = [1, 2, 3, 4]
```

Note, the running time of this function is `O(n)`.

#### `(:)`

``` purescript
Expand Down Expand Up @@ -158,6 +168,10 @@ determine the ordering of elements.
head :: forall a. Array a -> Maybe a
```

Get the first element in an array, or `Nothing` if the array is empty

Running time: `O(1)`.

#### `last`

``` purescript
Expand Down Expand Up @@ -215,6 +229,9 @@ f arr = case uncons arr of
index :: forall a. Array a -> Int -> Maybe a
```

This function provides a safe way to read a value at a particular index
from an array.

#### `(!!)`

``` purescript
Expand Down Expand Up @@ -309,6 +326,8 @@ index is out-of-bounds.
reverse :: forall a. Array a -> Array a
```

Reverse an array, creating a new array.

#### `concat`

``` purescript
Expand All @@ -335,6 +354,16 @@ filter :: forall a. (a -> Boolean) -> Array a -> Array a
Filter an array, keeping the elements which satisfy a predicate function,
creating a new array.

#### `partition`

``` purescript
partition :: forall a. (a -> Boolean) -> Array a -> { yes :: Array a, no :: Array a }
```

Partition an array using a predicate function, creating a set of
new arrays. One for the values satisfying the predicate function
and one for values that don't.

#### `filterM`

``` purescript
Expand Down Expand Up @@ -372,6 +401,8 @@ a value, creating a new array.
sort :: forall a. (Ord a) => Array a -> Array a
```

Sort the elements of an array in increasing order, creating a new array.

#### `sortBy`

``` purescript
Expand All @@ -387,6 +418,8 @@ the specified partial ordering, creating a new array.
slice :: forall a. Int -> Int -> Array a -> Array a
```

Extract a subarray by a start and end index.

#### `take`

``` purescript
Expand Down

0 comments on commit bf7dd08

Please sign in to comment.