Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Oct 23, 2024
1 parent 7f31957 commit 0a94c55
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/milestone/Collatz/Collatz.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ resultHeading : String := "Collatz sequence:";

main : IO :=
printStringLn welcome
>>> readLn λ {s := printStringLn resultHeading >>> run collatz (stringToNat s)};
>>> readLn λ{s := printStringLn resultHeading >>> run collatz (stringToNat s)};
8 changes: 4 additions & 4 deletions tests/positive/Format.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ exampleFunction2
-> List A
-> List A
-> Nat :=
λ {_ _ _ _ _ _ _ _ _ _ :=
λ{_ _ _ _ _ _ _ _ _ _ :=
undefined
-- comment after first
+ undefined
Expand All @@ -186,11 +186,11 @@ positive
type T0 (A : Type) := c0 : (A -> T0 A) -> T0 A;

-- Single Lambda clause
idLambda : {A : Type} -> A -> A := λ {x := x};
idLambda : {A : Type} -> A -> A := λ{x := x};

-- Lambda clauses
f : Nat -> Nat :=
\ {
\{
-- comment before lambda pipe
| zero :=
let
Expand Down Expand Up @@ -305,7 +305,7 @@ module Traits;
instance
showBoolI : Show Bool :=
mkShow@{
show := λ {x := ite x "true" "false"}
show := λ{x := ite x "true" "false"}
};

instance
Expand Down
2 changes: 1 addition & 1 deletion tests/positive/InstanceImport/M.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ type T A := mkT@{pp : A → A};
type Unit := unit;

instance
unitI : T Unit := mkT λ {x := x};
unitI : T Unit := mkT λ{x := x};
2 changes: 1 addition & 1 deletion tests/positive/InstanceImport/Main.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ type Bool :=
| false;

instance
boolI : T Bool := mkT λ {x := x};
boolI : T Bool := mkT λ{x := x};

main : Bool := case T.pp unit of unit := T.pp true;
4 changes: 2 additions & 2 deletions tests/positive/SignatureWithBody.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ module SignatureWithBody;
import Stdlib.Prelude open;

isNull : {A : Type} → List A → Bool :=
λ {
λ{
| nil := true
| _ := false
};

isNull' : {A : Type} → List A → Bool :=
let
aux : {A : Type} → List A → Bool :=
λ {
λ{
| nil := true
| _ := false
};
Expand Down
8 changes: 4 additions & 4 deletions tests/positive/StdlibList/Data/List.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ filter : (a : Type) → (a → Bool) → List a → List a
| a f (:: h hs) :=
match
(f h)
λ {
λ{
| true := :: h (filter a f hs)
| false := filter a f hs
};
Expand Down Expand Up @@ -65,14 +65,14 @@ splitAt : (a : Type) → ℕ → List a → List a × List a
| a _ nil := , nil nil
| a zero xs := , nil xs
| a (suc zero) (:: x xs) := , (:: x nil) xs
| a (suc (suc m)) (:: x xs) := match (splitAt a m xs) λ {(, xs' xs'') := , (:: x xs') xs''};
| a (suc (suc m)) (:: x xs) := match (splitAt a m xs) λ{(, xs' xs'') := , (:: x xs') xs''};

terminating
merge : (a : Type) → (a → a → Ordering) → List a → List a → List a
| a cmp (:: x xs) (:: y ys) :=
match
(cmp x y)
λ {
λ{
| LT := :: x (merge a cmp xs (:: y ys))
| _ := :: y (merge a cmp (:: x xs) ys)
}
Expand All @@ -92,7 +92,7 @@ quickSort : (a : Type) → (a → a → Ordering) → List a → List a
ltx (y : a) : Bool :=
match
(cmp y x)
λ {
λ{
| LT := true
| _ := false
};
Expand Down

0 comments on commit 0a94c55

Please sign in to comment.