-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from jonlaing/kujon-refmt
Refmt 3.3.3
- Loading branch information
Showing
13 changed files
with
258 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
let allPass = (fs, x) => List.fold_left((acc, f) => acc ? f(x) : acc, true, fs); | ||
let allPass = (fs, x) => | ||
List.fold_left((acc, f) => acc ? f(x) : acc, true, fs); | ||
|
||
let and_ = (a, b) => a && b; | ||
|
||
let anyPass = (fs, x) => List.fold_left((acc, f) => acc ? acc : f(x), false, fs); | ||
let anyPass = (fs, x) => | ||
List.fold_left((acc, f) => acc ? acc : f(x), false, fs); | ||
|
||
let both = (f, g, x) => f(x) && g(x); | ||
|
||
let either = (f, g, x) => f(x) || g(x); | ||
|
||
let not_ = (f, x) => ! f(x); | ||
let not_ = (f, x) => !f(x); | ||
|
||
let or_ = (a, b) => a || b; | ||
|
||
let unless = (pred, f, x) => pred(x) ? x : f(x); | ||
|
||
let rec until = (pred, f, x) => pred(x) ? x : until(pred, f, f(x)); | ||
|
||
let when_ = (pred, f, x) => unless(not_(pred), f, x); | ||
let when_ = (pred, f, x) => unless(not_(pred), f, x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.