From 63354150972c6c348fa848f0668ad47250889813 Mon Sep 17 00:00:00 2001 From: acple Date: Wed, 14 Feb 2024 22:56:58 +0900 Subject: [PATCH 1/2] generalizes deleteBy parameter --- src/Data/Array.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 6b0609c6916294463c455faf89493b14f050ae06 Mon Sep 17 00:00:00 2001 From: acple Date: Thu, 15 Feb 2024 10:28:29 +0900 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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