Created
February 11, 2017 00:39
-
-
Save haesbaert/6a181d690f542c4fa892ef0726ae17bb to your computer and use it in GitHub Desktop.
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
(* case 1 *) | |
let rec expand need kn = | |
if (Cstruct.len kn) >= need then | |
kn | |
else | |
expand need (hf [k; h; kn]) | |
in | |
(* case 2 *) | |
let need = 10 in | |
let rec expand kn = | |
if (Cstruct.len kn) >= need then | |
kn | |
else | |
expand (hf [k; h; kn]) | |
in | |
Q) Are both tail recursive ? case 2 captures the bound outer 'n', does it still tailcall ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment