Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Sep 28, 2023
1 parent 23f6b19 commit 0a89f06
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Stdlib/Data/List/Base.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ merge {A} {{Ord A}} : List A → List A → List A
partition {A} (f : A → Bool) : List A → List A × List A
| nil := nil, nil
| (x :: xs) :=
case partition f xs of {l1, l2 :=
if (f x) (x :: l1, l2) (l1, x :: l2)};
case partition f xs of {
l1, l2 := if (f x) (x :: l1, l2) (l1, x :: l2)
};

syntax operator ++ cons;

Expand Down Expand Up @@ -209,8 +210,9 @@ quickSort {A} {{Ord A}} : List A → List A :=
| nil := nil
| xs@(_ :: nil) := xs
| (x :: xs) :=
case partition (isGT ∘ Ord.cmp x) xs of {l1, l2 :=
go l1 ++ x :: go l2};
case partition (isGT ∘ Ord.cmp x) xs of {
l1, l2 := go l1 ++ x :: go l2
};
in go;

--- 𝒪(𝓃) Filters out every ;nothing; from a ;List;.
Expand Down

0 comments on commit 0a89f06

Please sign in to comment.