Skip to content

Commit f361514

Browse files
andrewthadtreeowl
authored andcommitted
remove unused array filter function
1 parent f8f7491 commit f361514

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

Data/HashMap/Array.hs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ module Data.HashMap.Array
4747
, map'
4848
, traverse
4949
, traverse'
50-
, filter
5150
, toList
5251
, fromList
5352
) where
@@ -577,21 +576,3 @@ traverseIO' f = \ ary0 ->
577576
"traverse'/ST" forall f. traverse' f = traverseST' f
578577
"traverse'/IO" forall f. traverse' f = traverseIO' f
579578
#-}
580-
581-
filter :: (a -> Bool) -> Array a -> Array a
582-
filter p = \ ary ->
583-
let !n = length ary
584-
in run $ do
585-
mary <- new_ n
586-
go ary mary 0 0 n
587-
where
588-
go ary mary i j n
589-
| i >= n = if i == j
590-
then return mary
591-
else do mary2 <- new_ j
592-
copyM mary 0 mary2 0 j
593-
return mary2
594-
| p el = write mary j el >> go ary mary (i+1) (j+1) n
595-
| otherwise = go ary mary (i+1) j n
596-
where el = index ary i
597-
{-# INLINE filter #-}

0 commit comments

Comments
 (0)