diff options
author | Michael Mark <michael.mark@oit.edu> | 2024-05-24 20:37:23 -0700 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-05-29 12:26:22 +0100 |
commit | db67449953c847934025d7f82255bad78777d207 (patch) | |
tree | 89858deabd06800eb65a40fbf9e9863d13c4e3c6 /src | |
parent | c0e9a4838abd09cd9bca12c4ab80442973217ab4 (diff) | |
download | gleam_stdlib-db67449953c847934025d7f82255bad78777d207.tar.gz gleam_stdlib-db67449953c847934025d7f82255bad78777d207.zip |
gleam format
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/list.gleam | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index 2e8e019..2fff079 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -1240,18 +1240,14 @@ fn sequences( // consecutive equal items) while a descreasing sequence is strictly // decreasing (no consecutive equal items), this is needed to make the // algorithm stable! - order.Gt, Descending - | order.Lt, Ascending - | order.Eq, Ascending -> + order.Gt, Descending | order.Lt, Ascending | order.Eq, Ascending -> sequences(rest, compare, growing, direction, new, acc) // We were growing an ascending (descending) sequence and the new item // is smaller (bigger) than the previous one, this means we have to stop // growing this sequence and start with a new one whose first item will // be the one we just found. - order.Gt, Ascending - | order.Lt, Descending - | order.Eq, Descending -> { + order.Gt, Ascending | order.Lt, Descending | order.Eq, Descending -> { let acc = case direction { Ascending -> [do_reverse(growing, []), ..acc] Descending -> [growing, ..acc] @@ -1374,8 +1370,8 @@ fn merge_ascendings( [first1, ..rest1], [first2, ..rest2] -> case compare(first1, first2) { order.Lt -> merge_ascendings(rest1, list2, compare, [first1, ..acc]) - order.Gt - | order.Eq -> merge_ascendings(list1, rest2, compare, [first2, ..acc]) + order.Gt | order.Eq -> + merge_ascendings(list1, rest2, compare, [first2, ..acc]) } } } @@ -1400,8 +1396,8 @@ fn merge_descendings( [first1, ..rest1], [first2, ..rest2] -> case compare(first1, first2) { order.Lt -> merge_descendings(list1, rest2, compare, [first2, ..acc]) - order.Gt - | order.Eq -> merge_descendings(rest1, list2, compare, [first1, ..acc]) + order.Gt | order.Eq -> + merge_descendings(rest1, list2, compare, [first1, ..acc]) } } } |