Aelve Codesearch

grep over package repositories
Please provide a string to search for.
3+ characters are required.
Index updated about a month ago

total matches: 5

numeric-prelude-0.4.3.1
2 matches
src/MathObj/Permutation/CycleList.hs
cyclesOrbit p = orbit (p *>)

orbit :: (Ord i) => (i -> i) -> i -> [i]
orbit op x0 = takeUntilRepetition (iterate op x0)

-- | candidates for Utility ?
takeUntilRepetition :: Ord a => [a] -> [a]
takeUntilRepetition xs =
   let accs = scanl (flip Set.insert) Set.empty xs
       lenlist = takeWhile not (zipWith Set.member xs accs)
   in  Match.take lenlist xs

takeUntilRepetitionSlow :: Eq a => [a] -> [a]

            
src/MathObj/Permutation/CycleList.hs
       lenlist = takeWhile not (zipWith Set.member xs accs)
   in  Match.take lenlist xs

takeUntilRepetitionSlow :: Eq a => [a] -> [a]
takeUntilRepetitionSlow xs =
   let accs = scanl (flip (:)) [] xs
       lenlist = takeWhile not (zipWith elem xs accs)
   in  Match.take lenlist xs