Skip to content

Commit

Permalink
Lazy || and && (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz authored Jan 26, 2023
2 parents 5614bac + d494ecb commit 9e616a9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Stdlib/Data/Bool.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@ not true := false;
not false := true;

infixr 2 ||;
builtin bool-or
|| : Bool → Bool → Bool;
|| false a := a;
|| true _ := true;
|| false a := a;

infixr 2 &&;
builtin bool-and
&& : Bool → Bool → Bool;
&& false _ := false;
&& true a := a;
&& false _ := false;

builtin bool-if
if : {A : Type} → Bool → A → A → A;
if true a _ := a;
if false _ b := b;

or : Bool → Bool → Bool;
or a b := a || b;

and : Bool → Bool → Bool;
and a b := a && b;

end;

0 comments on commit 9e616a9

Please sign in to comment.