Skip to main content

List of templates that may help development.

from version: 0.103

OCaml

Scope: *.ml and *.mli.

  • begin
begin

end
  • class
class name =
object (self)
contents
end
  • for
for i = starval to endval do
code
done
  • fun
(fun () -> body)
  • func
(function
| patt1 -> expr1
| patt2 -> expr2)
  • if
if (cond) then expr else expr2
  • let
let var(s) = expr
  • lin
let var(s) = expr in expr2
  • match
match value with
| patt -> expr
| _ -> expr2
  • method
method name = 
  • msig
module Name : sig

end
  • mstruct
module Name = struct

end
  • mtype
module type Name = sig

end
  • thread
ignore (Thread.create (fun () -> 

) ())
  • try
try

with
| _ -> failwith "Unknown"
  • type
type name = expr
  • while
while condition do

done