2013-04-02 16:00:55 -04:00
|
|
|
snippet rs "raise" b
|
|
|
|
raise (${1:Not_found})
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet open "open"
|
|
|
|
let open ${1:module} in
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet try "try"
|
2013-06-22 20:30:26 -04:00
|
|
|
try ${1}
|
2013-04-02 16:00:55 -04:00
|
|
|
with ${2:Not_found} -> ${3:()}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet ref "ref"
|
2013-06-22 20:30:26 -04:00
|
|
|
let ${1} = ref ${2} in
|
|
|
|
${3}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet matchl "pattern match on a list"
|
|
|
|
match ${1:list} with
|
|
|
|
| [] -> ${2:()}
|
|
|
|
| x::xs -> ${3:()}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet matcho "pattern match on an option type"
|
2013-06-22 20:30:26 -04:00
|
|
|
match ${1} with
|
|
|
|
| Some(${2}) -> ${3:()}
|
2013-04-02 16:00:55 -04:00
|
|
|
| None -> ${4:()}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet fun "anonymous function"
|
2013-06-22 20:30:26 -04:00
|
|
|
(fun ${1} -> ${2})
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet cc "commment"
|
2013-06-22 20:30:26 -04:00
|
|
|
(* ${1} *)
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet let "let .. in binding"
|
2013-06-22 20:30:26 -04:00
|
|
|
let ${1} = ${2} in
|
|
|
|
${3}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet lr "let rec"
|
2013-06-22 20:30:26 -04:00
|
|
|
let rec ${1} =
|
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
2013-06-22 20:30:26 -04:00
|
|
|
snippet ife "if"
|
|
|
|
if ${1} then
|
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
else
|
2013-06-22 20:30:26 -04:00
|
|
|
${3}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
2013-06-22 20:30:26 -04:00
|
|
|
snippet if "If"
|
|
|
|
if ${1} then
|
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet while "while"
|
2013-06-22 20:30:26 -04:00
|
|
|
while ${1} do
|
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
done
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet for "for"
|
|
|
|
for ${1:i} = ${2:1} to ${3:10} do
|
2013-06-22 20:30:26 -04:00
|
|
|
${4}
|
2013-04-02 16:00:55 -04:00
|
|
|
done
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet match "match"
|
2013-06-22 20:30:26 -04:00
|
|
|
match ${1} with
|
|
|
|
| ${2} -> ${3}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet class "class"
|
|
|
|
class ${1:name} = object
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet obj "obj"
|
|
|
|
object
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Obj "object"
|
|
|
|
object (self)
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet {{ "object functional update"
|
2013-06-22 20:30:26 -04:00
|
|
|
{< ${1} = ${2} >}
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet beg "beg"
|
|
|
|
begin
|
2013-06-22 20:30:26 -04:00
|
|
|
${1}${VISUAL}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet ml "module instantiantion with functor"
|
|
|
|
module ${1:Mod} = ${2:Functor}(${3:Arg})
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet mod "module - no signature"
|
|
|
|
module ${1:(* Name *)} = struct
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Mod "module with signature"
|
|
|
|
module ${1:(* Name *)} : ${2:(* SIG *)} = struct
|
2013-06-22 20:30:26 -04:00
|
|
|
${3}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet sig "anonymous signature"
|
|
|
|
sig
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet sigf "functor signature or anonymous functor"
|
|
|
|
functor (${1:Arg} : ${2:ARG}) -> ${3:(* BODY *)}
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet func "define functor - no signature"
|
|
|
|
module ${1:M} (${2:Arg} : ${3:ARG}) = struct
|
2013-06-22 20:30:26 -04:00
|
|
|
${4}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet Func "define functor - with signature"
|
|
|
|
module ${1:M} (${2:Arg} : ${3:ARG}) : ${4:SIG} = struct
|
2013-06-22 20:30:26 -04:00
|
|
|
${5}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet mot "Declare module signature"
|
|
|
|
module type ${1:(* Name *)} = sig
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet module "Module with anonymous signature"
|
|
|
|
module ${1:(* Name *)} : sig
|
2013-06-22 20:30:26 -04:00
|
|
|
${2}
|
2013-04-02 16:00:55 -04:00
|
|
|
end = struct
|
2013-06-22 20:30:26 -04:00
|
|
|
${3}
|
2013-04-02 16:00:55 -04:00
|
|
|
end
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet oo "odoc"
|
2013-06-22 20:30:26 -04:00
|
|
|
(** ${1} *)
|
2013-04-02 16:00:55 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet qt "inline qtest"
|
|
|
|
(*$T ${1:name}
|
|
|
|
${2:test}
|
|
|
|
*)
|
|
|
|
endsnippet
|