Created
February 25, 2024 12:54
-
-
Save jkone27/bca319ed6fc210c286858efa9678f927 to your computer and use it in GitHub Desktop.
ocaml sample file for comparison with F#
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
module Test = struct | |
let hello world = | |
"hello " ^ world | |
end | |
let lst = | |
[ | |
"world"; | |
"john"; | |
"BUG"; | |
"mary" | |
] | |
|> List.filter (fun x -> x <> "BUG") | |
|> List.map Test.hello | |
let () = | |
lst |> List.iter print_endline; | |
lst | |
|> List.fold_left (fun acc elem -> elem ^ "," ^ acc) "" | |
|> print_endline | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment