cycle package:ghc-lib-parser

cycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.

Examples

>>> cycle []
*** Exception: Prelude.cycle: empty list
>>> take 10 (cycle [42])
[42,42,42,42,42,42,42,42,42,42]
>>> take 10 (cycle [2, 5, 7])
[2,5,7,2,5,7,2,5,7,2]
>>> take 1 (cycle (42 : undefined))
[42]
Find a reasonably short cycle a->b->c->a, in a graph The graph might not necessarily be strongly connected.
TcRnSuperclassCycle is an error indicating that a class has a superclass cycle. Test cases: mod40, tcfail027, tcfail213, tcfail216, tcfail217, T9415, T9739
TcRnTypeSynonymCycle is an error indicating that a cycle between type synonyms has occurred. Test cases: mod27, ghc-e-fail2, bkpfail29
Add a new cycle-breaker binding to the top environment on the stack.
Perform a monadic operation on all pairs in the top environment in the stack.
Push a fresh environment onto the cycle-breaker var stack. Useful when entering a nested implication.