ListPackage T

logic.spad line 129 [edit on github]

splitting lists

cartesian: List List T -> List List T

cartesian([S1, S2, ...]) returns the set of lists [s1, s2, …] with si in Si

cartesianPower: (List T, NonNegativeInteger) -> List List T

cartesianPower(S, n) returns the n-th cartesian power of the list S

minShift: List T -> List T if T has OrderedSet

minShift(l) returns the lexicographically minimal cyclic rotation of the list l

shiftLeft: List T -> List T

leftShift(l) rotates the list l to the left and inserts the first element at the end

splitList: (T -> Boolean, List T) -> Record(yes: List T, no: List T)

splitList(f, x) splits the list x into a yes part and a no part according to the boolean function f

topologicalSort!: ((T, T) -> Boolean, List T) -> List T

topologicalSort(xx) returns a rearrangement of the elements which is compatible with the partial order. The argument list xx is destroyed.

topologicalSort: ((T, T) -> Boolean, List T) -> List T

topologicalSort(xx) returns a rearrangement of the elements which is compatible with the partial order.

topologicalSort: (List List Boolean, List T) -> List T

topologicalSort(xx) returns a rearrangement of the elements which is compatible with the partial order. (Martin Baker) I added this version because predicate function can be difficult to work with so use table instead.