diff --git a/Sources/DataStructures/Either.swift b/Sources/DataStructures/ADTs/Either.swift similarity index 100% rename from Sources/DataStructures/Either.swift rename to Sources/DataStructures/ADTs/Either.swift diff --git a/Sources/DataStructures/IntervalRelation.swift b/Sources/DataStructures/ADTs/IntervalRelation.swift similarity index 100% rename from Sources/DataStructures/IntervalRelation.swift rename to Sources/DataStructures/ADTs/IntervalRelation.swift diff --git a/Sources/DataStructures/InvertibleEnum.swift b/Sources/DataStructures/ADTs/InvertibleEnum.swift similarity index 100% rename from Sources/DataStructures/InvertibleEnum.swift rename to Sources/DataStructures/ADTs/InvertibleEnum.swift diff --git a/Sources/DataStructures/Pair/Cross.swift b/Sources/DataStructures/ADTs/Pairs/Cross.swift similarity index 100% rename from Sources/DataStructures/Pair/Cross.swift rename to Sources/DataStructures/ADTs/Pairs/Cross.swift diff --git a/Sources/DataStructures/Pair/OrderedPair.swift b/Sources/DataStructures/ADTs/Pairs/OrderedPair.swift similarity index 100% rename from Sources/DataStructures/Pair/OrderedPair.swift rename to Sources/DataStructures/ADTs/Pairs/OrderedPair.swift diff --git a/Sources/DataStructures/Pair/Pair.swift b/Sources/DataStructures/ADTs/Pairs/Pair.swift similarity index 100% rename from Sources/DataStructures/Pair/Pair.swift rename to Sources/DataStructures/ADTs/Pairs/Pair.swift diff --git a/Sources/DataStructures/Pair/SwappablePair.swift b/Sources/DataStructures/ADTs/Pairs/SwappablePair.swift similarity index 100% rename from Sources/DataStructures/Pair/SwappablePair.swift rename to Sources/DataStructures/ADTs/Pairs/SwappablePair.swift diff --git a/Sources/DataStructures/Pair/SymmetricPair.swift b/Sources/DataStructures/ADTs/Pairs/SymmetricPair.swift similarity index 100% rename from Sources/DataStructures/Pair/SymmetricPair.swift rename to Sources/DataStructures/ADTs/Pairs/SymmetricPair.swift diff --git a/Sources/DataStructures/Pair/UnorderedPair.swift b/Sources/DataStructures/ADTs/Pairs/UnorderedPair.swift similarity index 100% rename from Sources/DataStructures/Pair/UnorderedPair.swift rename to Sources/DataStructures/ADTs/Pairs/UnorderedPair.swift diff --git a/Sources/DataStructures/CollectionExtensions.swift b/Sources/DataStructures/Extras/CollectionExtensions.swift similarity index 98% rename from Sources/DataStructures/CollectionExtensions.swift rename to Sources/DataStructures/Extras/CollectionExtensions.swift index a5b7c8e..5cdb723 100644 --- a/Sources/DataStructures/CollectionExtensions.swift +++ b/Sources/DataStructures/Extras/CollectionExtensions.swift @@ -5,6 +5,7 @@ // Created by James Bean on 6/29/18. // +// TODO: Consider moving to the `Algorithms` module. extension Array { /// - Returns: Array with the `element` appended. diff --git a/Sources/DataStructures/Homogeneity.swift b/Sources/DataStructures/Extras/Homogeneity.swift similarity index 93% rename from Sources/DataStructures/Homogeneity.swift rename to Sources/DataStructures/Extras/Homogeneity.swift index 4e1583c..df5709b 100644 --- a/Sources/DataStructures/Homogeneity.swift +++ b/Sources/DataStructures/Extras/Homogeneity.swift @@ -7,6 +7,7 @@ import Destructure +// TODO: Consider moving to the `Algorithms` module. extension Sequence where Element: Equatable { /// - Returns: `true` if there are one or fewer elements in `self`, or if all elements in diff --git a/Sources/DataStructures/RangeProtocol+Algebra.swift b/Sources/DataStructures/Extras/RangeProtocol+Algebra.swift similarity index 93% rename from Sources/DataStructures/RangeProtocol+Algebra.swift rename to Sources/DataStructures/Extras/RangeProtocol+Algebra.swift index f3efb92..e0ffce9 100644 --- a/Sources/DataStructures/RangeProtocol+Algebra.swift +++ b/Sources/DataStructures/Extras/RangeProtocol+Algebra.swift @@ -7,6 +7,7 @@ import Algebra +// TODO: Consider moving to the `Algebra` module. extension ClosedRange: Zero where Bound: Zero { public static var zero: ClosedRange { diff --git a/Sources/DataStructures/RangeProtocol.swift b/Sources/DataStructures/Extras/RangeProtocol.swift similarity index 91% rename from Sources/DataStructures/RangeProtocol.swift rename to Sources/DataStructures/Extras/RangeProtocol.swift index e8ae779..0377465 100644 --- a/Sources/DataStructures/RangeProtocol.swift +++ b/Sources/DataStructures/Extras/RangeProtocol.swift @@ -6,6 +6,8 @@ // /// Unifying interface for `Range` and `ClosedRange` types. +/// +/// TODO: Consider using Standard Library's `RangeExpression` protocol instead. public protocol RangeProtocol { associatedtype Bound: Comparable var lowerBound: Bound { get } diff --git a/Sources/DataStructures/SequenceExtensions.swift b/Sources/DataStructures/Extras/SequenceExtensions.swift similarity index 96% rename from Sources/DataStructures/SequenceExtensions.swift rename to Sources/DataStructures/Extras/SequenceExtensions.swift index 77c224b..3c225d0 100644 --- a/Sources/DataStructures/SequenceExtensions.swift +++ b/Sources/DataStructures/Extras/SequenceExtensions.swift @@ -5,6 +5,7 @@ // Created by James Bean on 6/29/18. // +// TODO: Consider moving to the `Algorithms` module. extension Sequence { /// All of the values which are the least or greatest given the `areInIncreasingOrder` closure. diff --git a/Sources/DataStructures/SetExtensions.swift b/Sources/DataStructures/Extras/SetExtensions.swift similarity index 91% rename from Sources/DataStructures/SetExtensions.swift rename to Sources/DataStructures/Extras/SetExtensions.swift index 1a424ad..a425793 100644 --- a/Sources/DataStructures/SetExtensions.swift +++ b/Sources/DataStructures/Extras/SetExtensions.swift @@ -5,6 +5,7 @@ // Created by James Bean on 6/29/18. // +// TODO: Consider moving to the `Algorithms` module. extension Set { public func inserting(_ element: Element) -> Set { diff --git a/Sources/DataStructures/AdjacencyList.swift b/Sources/DataStructures/Graphs/Graph/AdjacencyList.swift similarity index 100% rename from Sources/DataStructures/AdjacencyList.swift rename to Sources/DataStructures/Graphs/Graph/AdjacencyList.swift diff --git a/Sources/DataStructures/Graph/DirectedGraph.swift b/Sources/DataStructures/Graphs/Graph/DirectedGraph.swift similarity index 100% rename from Sources/DataStructures/Graph/DirectedGraph.swift rename to Sources/DataStructures/Graphs/Graph/DirectedGraph.swift diff --git a/Sources/DataStructures/Graph/Graph.swift b/Sources/DataStructures/Graphs/Graph/Graph.swift similarity index 100% rename from Sources/DataStructures/Graph/Graph.swift rename to Sources/DataStructures/Graphs/Graph/Graph.swift diff --git a/Sources/DataStructures/Graph/Protocols/DirectedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/DirectedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/DirectedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/DirectedGraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/GraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/GraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/GraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/GraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/UndirectedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/UndirectedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/UndirectedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/UndirectedGraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/UnweightedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/UnweightedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/UnweightedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/UnweightedGraphProtocol.swift diff --git a/Sources/DataStructures/Graph/Protocols/WeightedGraphProtocol.swift b/Sources/DataStructures/Graphs/Graph/Protocols/WeightedGraphProtocol.swift similarity index 100% rename from Sources/DataStructures/Graph/Protocols/WeightedGraphProtocol.swift rename to Sources/DataStructures/Graphs/Graph/Protocols/WeightedGraphProtocol.swift diff --git a/Sources/DataStructures/ReferenceGraph.AdjacencyList.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.AdjacencyList.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.AdjacencyList.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.AdjacencyList.swift diff --git a/Sources/DataStructures/ReferenceGraph.Edge.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.Edge.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.Edge.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.Edge.swift diff --git a/Sources/DataStructures/ReferenceGraph.EdgeList.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.EdgeList.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.EdgeList.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.EdgeList.swift diff --git a/Sources/DataStructures/ReferenceGraph.Node.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.Node.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.Node.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.Node.swift diff --git a/Sources/DataStructures/ReferenceGraph.swift b/Sources/DataStructures/Graphs/Graph/ReferenceGraph.swift similarity index 100% rename from Sources/DataStructures/ReferenceGraph.swift rename to Sources/DataStructures/Graphs/Graph/ReferenceGraph.swift diff --git a/Sources/DataStructures/Graph/WeightedDirectedGraph.swift b/Sources/DataStructures/Graphs/Graph/WeightedDirectedGraph.swift similarity index 100% rename from Sources/DataStructures/Graph/WeightedDirectedGraph.swift rename to Sources/DataStructures/Graphs/Graph/WeightedDirectedGraph.swift diff --git a/Sources/DataStructures/Graph/WeightedGraph.swift b/Sources/DataStructures/Graphs/Graph/WeightedGraph.swift similarity index 100% rename from Sources/DataStructures/Graph/WeightedGraph.swift rename to Sources/DataStructures/Graphs/Graph/WeightedGraph.swift diff --git a/Sources/DataStructures/Bimap.swift b/Sources/DataStructures/Hash/Bimap.swift similarity index 100% rename from Sources/DataStructures/Bimap.swift rename to Sources/DataStructures/Hash/Bimap.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/ContiguousSegmentCollection.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/ContiguousSegmentCollection.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/ContiguousSegmentCollection.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/ContiguousSegmentCollection.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Fragmentable.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Fragmentable.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Fragmentable.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Fragmentable.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Intervallic.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Intervallic.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Intervallic.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Intervallic.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/IntervallicFragmentable.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/IntervallicFragmentable.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/IntervallicFragmentable.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/IntervallicFragmentable.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Measured.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Measured.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Measured.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Measured.swift diff --git a/Sources/DataStructures/ContiguousSegmentCollection/Totalizable.swift b/Sources/DataStructures/Hash/ContiguousSegmentCollection/Totalizable.swift similarity index 100% rename from Sources/DataStructures/ContiguousSegmentCollection/Totalizable.swift rename to Sources/DataStructures/Hash/ContiguousSegmentCollection/Totalizable.swift diff --git a/Sources/DataStructures/DictionaryProtocol.swift b/Sources/DataStructures/Hash/DictionaryProtocol.swift similarity index 100% rename from Sources/DataStructures/DictionaryProtocol.swift rename to Sources/DataStructures/Hash/DictionaryProtocol.swift diff --git a/Sources/DataStructures/OrderedDictionary.swift b/Sources/DataStructures/Hash/OrderedDictionary.swift similarity index 100% rename from Sources/DataStructures/OrderedDictionary.swift rename to Sources/DataStructures/Hash/OrderedDictionary.swift diff --git a/Sources/DataStructures/SortedDictionary.swift b/Sources/DataStructures/Hash/SortedDictionary.swift similarity index 100% rename from Sources/DataStructures/SortedDictionary.swift rename to Sources/DataStructures/Hash/SortedDictionary.swift diff --git a/Sources/DataStructures/CircularArray.swift b/Sources/DataStructures/Linear/CircularArray.swift similarity index 100% rename from Sources/DataStructures/CircularArray.swift rename to Sources/DataStructures/Linear/CircularArray.swift diff --git a/Sources/DataStructures/LinkedList.swift b/Sources/DataStructures/Linear/LinkedList.swift similarity index 100% rename from Sources/DataStructures/LinkedList.swift rename to Sources/DataStructures/Linear/LinkedList.swift diff --git a/Sources/DataStructures/Matrix.swift b/Sources/DataStructures/Linear/Matrix.swift similarity index 100% rename from Sources/DataStructures/Matrix.swift rename to Sources/DataStructures/Linear/Matrix.swift diff --git a/Sources/DataStructures/Queue.swift b/Sources/DataStructures/Linear/Queue.swift similarity index 100% rename from Sources/DataStructures/Queue.swift rename to Sources/DataStructures/Linear/Queue.swift diff --git a/Sources/DataStructures/SortedArray.swift b/Sources/DataStructures/Linear/SortedArray.swift similarity index 100% rename from Sources/DataStructures/SortedArray.swift rename to Sources/DataStructures/Linear/SortedArray.swift diff --git a/Sources/DataStructures/Stack.swift b/Sources/DataStructures/Linear/Stack.swift similarity index 100% rename from Sources/DataStructures/Stack.swift rename to Sources/DataStructures/Linear/Stack.swift diff --git a/Sources/DataStructures/Zip3Sequence.swift b/Sources/DataStructures/Linear/Zip3Sequence.swift similarity index 100% rename from Sources/DataStructures/Zip3Sequence.swift rename to Sources/DataStructures/Linear/Zip3Sequence.swift diff --git a/Sources/DataStructures/ZipToLongest.swift b/Sources/DataStructures/Linear/ZipToLongest.swift similarity index 100% rename from Sources/DataStructures/ZipToLongest.swift rename to Sources/DataStructures/Linear/ZipToLongest.swift diff --git a/Sources/DataStructures/AVLTree.swift b/Sources/DataStructures/Trees/AVLTree.swift similarity index 100% rename from Sources/DataStructures/AVLTree.swift rename to Sources/DataStructures/Trees/AVLTree.swift diff --git a/Sources/DataStructures/BinaryHeap.swift b/Sources/DataStructures/Trees/BinaryHeap.swift similarity index 100% rename from Sources/DataStructures/BinaryHeap.swift rename to Sources/DataStructures/Trees/BinaryHeap.swift diff --git a/Sources/DataStructures/BinarySearchTree.swift b/Sources/DataStructures/Trees/BinarySearchTree.swift similarity index 100% rename from Sources/DataStructures/BinarySearchTree.swift rename to Sources/DataStructures/Trees/BinarySearchTree.swift diff --git a/Sources/DataStructures/ReferenceTree.swift b/Sources/DataStructures/Trees/ReferenceTree.swift similarity index 100% rename from Sources/DataStructures/ReferenceTree.swift rename to Sources/DataStructures/Trees/ReferenceTree.swift diff --git a/Sources/DataStructures/ReferenceTreeProtocol.swift b/Sources/DataStructures/Trees/ReferenceTreeProtocol.swift similarity index 100% rename from Sources/DataStructures/ReferenceTreeProtocol.swift rename to Sources/DataStructures/Trees/ReferenceTreeProtocol.swift diff --git a/Sources/DataStructures/SingleTypedTree.swift b/Sources/DataStructures/Trees/SingleTypedTree.swift similarity index 100% rename from Sources/DataStructures/SingleTypedTree.swift rename to Sources/DataStructures/Trees/SingleTypedTree.swift diff --git a/Sources/DataStructures/Tree.Zipper.swift b/Sources/DataStructures/Trees/Tree.Zipper.swift similarity index 100% rename from Sources/DataStructures/Tree.Zipper.swift rename to Sources/DataStructures/Trees/Tree.Zipper.swift diff --git a/Sources/DataStructures/Tree.swift b/Sources/DataStructures/Trees/Tree.swift similarity index 100% rename from Sources/DataStructures/Tree.swift rename to Sources/DataStructures/Trees/Tree.swift diff --git a/Sources/DataStructures/Identifier.swift b/Sources/DataStructures/Wrapping/Identifier.swift similarity index 100% rename from Sources/DataStructures/Identifier.swift rename to Sources/DataStructures/Wrapping/Identifier.swift diff --git a/Sources/DataStructures/Metatype.swift b/Sources/DataStructures/Wrapping/Metatype.swift similarity index 100% rename from Sources/DataStructures/Metatype.swift rename to Sources/DataStructures/Wrapping/Metatype.swift diff --git a/Sources/DataStructures/NewType.swift b/Sources/DataStructures/Wrapping/NewType.swift similarity index 100% rename from Sources/DataStructures/NewType.swift rename to Sources/DataStructures/Wrapping/NewType.swift