Safe Haskell | None |
---|---|
Language | Haskell2010 |
Vector utilities
Documentation
vectorFirstDuplicate :: (Eq k, Hashable k) => Vector a -> (Int -> a -> k) -> Maybe (Int, Int) Source #
Finds the fist two elements which have the same key value for the specified key function
Arguments:
vec :: Vector a
: Vector to search duplicate inkeyfun :: (Int -> a -> k)
Key function, takes index and element as an input
Return value: two indices pointing the duplicate elements, Nothing
if no duplicates were found