diff --git a/CHANGELOG.md b/CHANGELOG.md index a680f26..1b4044e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ New features: Bugfixes: Other improvements: +- Generalizes the parameter type of `deleteBy` (#245 by @acple) ## [v7.3.0](https://github.com/purescript/purescript-arrays/releases/tag/v7.3.0) - 2023-11-03 diff --git a/src/Data/Array.purs b/src/Data/Array.purs index 431f942..608689d 100644 --- a/src/Data/Array.purs +++ b/src/Data/Array.purs @@ -1190,7 +1190,7 @@ delete = deleteBy eq -- | deleteBy mod3eq 6 [1, 3, 4, 3] = [1, 4, 3] -- | ``` -- | -deleteBy :: forall a. (a -> a -> Boolean) -> a -> Array a -> Array a +deleteBy :: forall a b. (b -> a -> Boolean) -> b -> Array a -> Array a deleteBy _ _ [] = [] deleteBy eq x ys = maybe ys (\i -> unsafePartial $ fromJust (deleteAt i ys)) (findIndex (eq x) ys)