Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/algorithms/capture.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
///
/// A simple wrapper around Array[DiffOp] that implements the DiffHook interface
/// This allows it to collect operations from any diff algorithm
type Capture Array[DiffOp] derive(Default)
struct Capture(Array[DiffOp]) derive(Default)

/// ================================================================================
/// CONSTRUCTION METHODS
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/moon.pkg.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"warn-list": "-1-2-3-5-6-7-8-10-29"
"warn-list": "+a"
}
23 changes: 0 additions & 23 deletions src/algorithms/range.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,3 @@ pub fn Range::iter(self : Range) -> Iter[Int] {
///
/// Additional utility methods that could be useful for range manipulation
/// These are not currently used but demonstrate the mathematical properties

///| Creates the intersection of two ranges
/// @return Range representing the overlap, or empty range if no overlap
fn Range::intersect(self : Range, other : Range) -> Range {
let start = @cmp.maximum(self.start, other.start)
let end = @cmp.minimum(self.end, other.end)
Range::new(start, end)
}

///| Creates the union of two ranges (smallest range containing both)
/// @return Range spanning both input ranges
fn Range::union(self : Range, other : Range) -> Range {
let start = @cmp.minimum(self.start, other.start)
let end = @cmp.maximum(self.end, other.end)
Range::new(start, end)
}

///| Splits the range at a given point
/// @param at The split point (must be within range)
/// @return Tuple of (left_range, right_range)
fn Range::split_at(self : Range, at : Int) -> (Range, Range) {
(Range::new(self.start, at), Range::new(at, self.end))
}
2 changes: 1 addition & 1 deletion src/moon.pkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"alias": "algorithms"
}
],
"warn-list": "-1-2-3-5-6-7-8-10-29"
"warn-list": "+a"
}
Loading