initial commit

This commit is contained in:
SowinskiBraeden committed 2026-01-13 09:30:23 -08:00
commit 8e5d6b27ff
5 files changed
+361

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
(*
ocamlc -o tinker tinker.ml
^^^ compile command
*)
(* Comments are weird *)
(*
concat takes to paramters a and b and concats them
together while seperated by a space
*)
let concat a b = a ^ " " ^ b;;
(*
describe maps the concat function to each element
in the list to describe the element with "eat"
*)
let describe = List.map (fun f -> concat "eat" f);;
let full_name = concat "Braeden" "Sowinski";;
print_endline full_name;;
let gruit = ["apple"; "banana"; "grape"];;
(*
takes in a list and iterates over elements
to print_endline the element
*)
let print_list_string list =
List.iter print_endline list;;
(*
I think this acts like a main method,
creates the describe list then iterates
and passes to the print_list_string function
*)
let () =
let eating = describe gruit in
print_list_string eating;;