ListPackage T¶
logic.spad line 129 [edit on github]
T: BasicType
splitting lists
- cartesian: List List T -> List List T
cartesian([S1, S2, ...])
returns the set of lists [s1
,s2
, …] withsi
inSi
- cartesianPower: (List T, NonNegativeInteger) -> List List T
cartesianPower(S, n)
returns then
-th cartesian power of the listS
- minShift: List T -> List T if T has OrderedSet
minShift(l)
returns the lexicographically minimal cyclic rotation of the listl
- shiftLeft: List T -> List T
leftShift(l)
rotates the listl
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 listx
into a yes part and a no part according to the boolean functionf
- 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 listxx
is destroyed.