Skip to content

Commit 5b14cb5

Browse files
committed
ocaml/nix-with-external-lib: init
Signed-off-by: lucasew <[email protected]>
1 parent f451411 commit 5b14cb5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ocaml/nix-with-external-lib

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env nix-shell
2+
(*
3+
#!nix-shell -i ocamlscript -p ocamlPackages.findlib ocaml ocamlPackages.batteries ocamlPackages.ocamlscript
4+
# vim:ft=ocaml
5+
*)
6+
7+
Ocaml.packs := ["batteries"];;
8+
--
9+
open Batteries
10+
11+
print_string "Hallo worldson\n";;
12+
13+
print_endline "eoq";;
14+
15+
let main () =
16+
(1--999)
17+
|> Enum.filter (fun i -> i mod 3 = 0 || i mod 5 = 0)
18+
|> Enum.reduce (+)
19+
|> Int.to_string
20+
|> print_endline
21+
let () = main ()

0 commit comments

Comments
 (0)