-
-
Save sshine/ef8c7c2e3c4f3f6c702a88b6cadf7f4a 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
open Base | |
let acronym s = | |
Buffer.contents | |
(String.foldi s | |
~init:(Buffer.create 4) | |
~f:(fun i buf c -> if c = ' ' then Buffer.add_char buf (String.get s (i+1)) else () ; buf)) | |
(* ^^^^^^^ *) |
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
File "acronym.ml", line 8, characters 29-30: | |
Error: This expression has type String.elt | |
but an expression was expected of type int |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment