ccomb/cycle-detect/1.0.0

NOTE: the latest version is 1.2.0

Graph

Your graph is defined by a type a and a function that give the next element in the graph, if any. isCycle tells you wether the graph is a cycle.

Cycle detection

isCycle : (a -> Maybe a) -> a -> Bool

Takes a function that gives the possible next element in the graph and the first element, returns True if the graph is a cycle