Skip to content

Commit 1e6b0f6

Browse files
committed
Refactor function signatures for readability
Reformatted multi-argument function signatures in pair and list_compare_go for improved readability and consistency. No functional changes were made.
1 parent e73428c commit 1e6b0f6

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/cmp.gleam

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
1+
import gleam/float
22
import gleam/int
33
import gleam/option
44
import gleam/order
55
import gleam/string
6-
import gleam/float
76

87
/// A comparator for values of type `a`.
98
/// Returns an `order.Order` from the stdlib `order` module.
@@ -167,7 +166,10 @@ pub fn lazy_then(
167166
/// Compare two pairs (tuples of two elements) using provided comparators
168167
/// for the first and second element respectively.
169168
/// Useful for common `(a, b)` sorting patterns.
170-
pub fn pair(a_cmp: Comparator(a), b_cmp: Comparator(b)) -> fn(#(a, b), #(a, b)) -> order.Order {
169+
pub fn pair(
170+
a_cmp: Comparator(a),
171+
b_cmp: Comparator(b),
172+
) -> fn(#(a, b), #(a, b)) -> order.Order {
171173
fn(x, y) {
172174
case x {
173175
#(ax, bx) ->
@@ -207,7 +209,11 @@ pub fn triple(
207209
}
208210

209211
// Helper: compare two lists lexicographically (top-level to allow recursion).
210-
fn list_compare_go(elem_cmp: fn(a, a) -> order.Order, xl: List(a), yl: List(a)) -> order.Order {
212+
fn list_compare_go(
213+
elem_cmp: fn(a, a) -> order.Order,
214+
xl: List(a),
215+
yl: List(a),
216+
) -> order.Order {
211217
case xl {
212218
[] ->
213219
case yl {

0 commit comments

Comments
 (0)