Skip to content

Fix minor documentation issue with find #216

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 3 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 4 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ New features:
Bugfixes:

Other improvements:
- Fixed minor documention issue with `find` (#216 by @JamieBallingall)

## [v6.0.1](https://github.com/purescript/purescript-arrays/releases/tag/v6.0.1) - 2021-04-19

Expand All @@ -26,7 +27,7 @@ Breaking changes:

New features:
- Added specialized versions of the functions from `Data.Foldable` (#201):
- Added `foldl`, `foldr`, `foldMap`, `fold`, `intercalate` to `Array`
- Added `foldl`, `foldr`, `foldMap`, `fold`, `intercalate` to `Array`
- Added `foldl1`, `foldr1`, `foldMap1`, `foldl1`, `intercalate` to `Array.NonEmpty`
- Added specialized `elem`, `notElem`, `find`, `findMap`, `scanl`, `scanr`, `any`, `all` (#189, #193, #201)
- Added `intersperse`, `groupAllBy`, `splitAt` (#179, #188, #194, #200, #201)
Expand All @@ -41,9 +42,9 @@ Other improvements:
- Migrated to GitHub Actions for CI (#187, #169)
- Removed some internal usages of `unsafeCoerce` (#184)
- Changed `foldM` type signature to more closely match `foldl` (#160)
- Updated installation instructions to use Spago (#171)
- Updated installation instructions to use Spago (#171)
- Replaced foreign `cons`, `snoc`, `drop`, `take` with PureScript implementations (#180)
- Removed `return {}` from FFI function for a small performance boost (#175)
- Removed `return {}` from FFI function for a small performance boost (#175)
- Bumped pulp version (#174)
- Removed primes from foreign modules exports (#168)

Expand Down Expand Up @@ -311,9 +312,4 @@ Added `mapMaybe`

## [v0.1.1](https://github.com/purescript/purescript-arrays/releases/tag/v0.1.1) - 2014-04-27



## [v0.1.0](https://github.com/purescript/purescript-arrays/releases/tag/v0.1.0) - 2014-04-25



4 changes: 2 additions & 2 deletions src/Data/Array.purs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ elemLastIndex x = findLastIndex (_ == x)
-- | Find the first element for which a predicate holds.
-- |
-- | ```purescript
-- | findIndex (contains $ Pattern "b") ["a", "bb", "b", "d"] = Just "bb"
-- | findIndex (contains $ Pattern "x") ["a", "bb", "b", "d"] = Nothing
-- | find (contains $ Pattern "b") ["a", "bb", "b", "d"] = Just "bb"
-- | find (contains $ Pattern "x") ["a", "bb", "b", "d"] = Nothing
-- | ```
find :: forall a. (a -> Boolean) -> Array a -> Maybe a
find f xs = unsafePartial (unsafeIndex xs) <$> findIndex f xs
Expand Down