This file contains hidden or 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
21:34 ➜ llvm-project git:(d28af7c65) ✗ pwd | |
/home/dhruv/llvm-project | |
21:34 ➜ llvm-project git:(d28af7c65) ✗ git --no-pager diff | |
diff --git a/clang/docs/doxygen.cfg.in b/clang/docs/doxygen.cfg.in | |
index 449552d99..9d1d70d3b 100644 | |
--- a/clang/docs/doxygen.cfg.in | |
+++ b/clang/docs/doxygen.cfg.in | |
@@ -1070,7 +1070,7 @@ HTML_STYLESHEET = | |
# see the documentation. | |
# This tag requires that the tag GENERATE_HTML is set to YES. |
This file contains hidden or 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
/* Imperative for-loop for factorial: | |
--------------------------------- | |
int factorial(int n) | |
int result = 1 | |
for (int i = 2; i <= n; i = i + 1) | |
result = result * i | |
return result | |
*/ | |
/* Transformation of for-loop into recursive function: | |
-------------------------------------------------- |
This file contains hidden or 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
let id = x => x; | |
let just = (y, _) => y; | |
let (+) = (f, g, x) => f(x) +. g(x); | |
let (-) = (f, g, x) => f(x) -. g(x); | |
let ( * ) = (f, g, x) => f(x) *. g(x); | |
let (@) = (f, g, x) => f(g(x)); | |
let sq = id * id; | |
let f = id + sin * (cos @ sq) - just(3.); | |
/* Outside Inwards */ |
This file contains hidden or 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
let directSumFrom1To = (n: int): int => n * (n + 1) / 2; | |
let directSumFrom1To: int => int = n => n * (n + 1) / 2; | |
let directSumFrom1To = n => n * (n + 1) / 2; | |
/* Step 1 */ | |
/* | |
* let choose_from = (k, n) => | |
* choose_from(k - 1, n - 1) + choose_from(k, n - 1); | |
*/ |
This file contains hidden or 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
(* helper functions for performance test *) | |
(* test one operation c times, output the mean time *) | |
let test_op s c op = | |
let ttime = ref 0. in | |
for i = 1 to c do | |
Gc.compact (); | |
let t0 = Unix.gettimeofday () in | |
let _ = op () in | |
let t1 = Unix.gettimeofday () in |