Gistlib Logo

gistlib

is there ocaml equivalent of def maxli li = li.max in ruby

let maxli li = List.fold_left max (List.hd li) li
50 chars
2 lines

similar ruby code snippets

how do i use list.fold_left in ocaml, give examples and in ruby
what is this sml: `fun max xs = foldl int.max (hd xs) (tl xs)` in ocaml and in ruby
is there a ruby's lst.max in ocaml in ruby
in ocaml, how do i find the max value of a list of ints? in ruby
in ocaml, i ran this caml program: `x + 2 where x = 34` why did it fail? in ruby
find the index of an element in an array in ruby
remove an element from the beginning of an array in ruby
insert an element into an array at a specific index in ruby
remove an element from the middle of an array in ruby
remove an element from an array at a specific index in ruby

related categories

ocaml
functional-programming

gistlibby LogSnag