File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,10 @@ module Data.Array.NonEmpty
8080
8181 , (\\), difference
8282 , difference'
83- -- , intersect
84- -- , intersectBy
83+ , intersect
84+ , intersect'
85+ , intersectBy
86+ , intersectBy'
8587
8688 , zipWith
8789 , zipWithA
@@ -417,7 +419,7 @@ unionBy
417419 -> NonEmptyArray a
418420 -> NonEmptyArray a
419421 -> NonEmptyArray a
420- unionBy eq xs ys = unsafeFromArray $ A . unionBy eq (toArray xs) (toArray ys)
422+ unionBy eq xs = unionBy' eq xs <<< toArray
421423
422424unionBy'
423425 :: forall a
@@ -439,6 +441,28 @@ difference xs = adaptAny $ difference' xs
439441difference' :: forall a . Eq a => NonEmptyArray a -> Array a -> Array a
440442difference' xs = A .difference $ toArray xs
441443
444+ intersect :: forall a . Eq a => NonEmptyArray a -> NonEmptyArray a -> Array a
445+ intersect = intersectBy eq
446+
447+ intersect' :: forall a . Eq a => NonEmptyArray a -> Array a -> Array a
448+ intersect' = intersectBy' eq
449+
450+ intersectBy
451+ :: forall a
452+ . (a -> a -> Boolean )
453+ -> NonEmptyArray a
454+ -> NonEmptyArray a
455+ -> Array a
456+ intersectBy eq xs = intersectBy' eq xs <<< toArray
457+
458+ intersectBy'
459+ :: forall a
460+ . (a -> a -> Boolean )
461+ -> NonEmptyArray a
462+ -> Array a
463+ -> Array a
464+ intersectBy' eq xs = A .intersectBy eq (toArray xs)
465+
442466infix 5 difference as \\
443467
444468zipWith
You can’t perform that action at this time.
0 commit comments