rearrangeCaller :: (Ord a,Ord b,Integral c,Num c) => (Maybe b -> b) -> V.Vector a -> V.Vector c -> V.Vector b -> V.Vector c -> ST s (V.Vector a,V.Vector b,V.Vector c)
rearrangeCaller f vectorA indexA vectorB indexB = do
  mutableIndex <- V.thaw indexA
  acc <- VM.replicate (V.length vectorA) Nothing
  let reader = RearrangeRead vectorA vectorB acc mutableIndex indexB
  (RearrangeState _ extraA extraB _) <- runReaderT (execStateT rearrange defaultRearrangeState) reader
  freezed <- V.freeze acc
  let returnA = vectorA V.++ (V.fromList . toList $ extraA)
      returnB = V.map f freezed V.++ (V.fromList . toList $ extraB)
  returnC <- V.freeze mutableIndex
  return (returnA,returnB,returnC)
rearrangeCaller :: (Ord a,Ord b,Integral c,Num c) => (Maybe b -> b) -> V.Vector a -> V.Vector c -> V.Vector b -> V.Vector c -> ST s (V.Vector a,V.Vector b,V.Vector c)
rearrangeCaller f vectorA indexA vectorB indexB = do
  mutableIndex <- V.thaw indexA
  acc <- VM.replicate (V.length vectorA) Nothing
  let reader = RearrangeRead vectorA vectorB acc mutableIndex indexB
  (RearrangeState _ extraA extraB _) <- runReaderT (execStateT rearrange defaultRearrangeState) reader
  freezed <- V.freeze acc
  let returnA = vectorA V.++ (V.fromList . toList $ extraA)
      returnB = V.map f freezed V.++ (V.fromList . toList $ extraB)
  returnC <- V.freeze mutableIndex
  return (returnA,returnB,returnC)
rearrangeCaller f vectorA indexA vectorB indexB = do
  mutableIndex <- V.thaw indexA
  acc <- VM.replicate (V.length vectorA) Nothing
  let reader = RearrangeRead vectorA vectorB acc mutableIndex indexB
  (RearrangeState _ extraA extraB _) <- runReaderT (execStateT rearrange defaultRearrangeState) reader
  freezed <- V.freeze acc
  let returnA = vectorA V.++ (V.fromList . toList $ extraA)
      returnB = V.map f freezed V.++ (V.fromList . toList $ extraB)
  returnC <- V.freeze mutableIndex
  return (returnA,returnB,returnC)