\newcommand{\MinML}{\mbox{\textsf{MinML}}}
\newcommand{\PolyMinML}{\mbox{\textsf{PolyMinML}}}
\newcommand{\MinMLSub}{\mbox{$\mathsf{MinML}_{\SubType}$}}
\newcommand{\MinMLSubI}{\mbox{$\mathsf{\MinML}_{\SubType}^{i}$}}
\newcommand{\MinMLSubE}{\mbox{$\mathsf{\MinML}_{\SubType}^{e}$}}

\newcommand{\EmptyCtx}{\emptyset}
\newcommand{\UpdCtx}[3]{{#1}[{#2}={#3}]}

\newcommand{\Gvdash}{\Gamma\vdash}

\newcommand{\Dec}[2]{{#1}\mathcd{:}{#2}}

\newcommand{\IsOK}[1]{{#1}\ \mathsf{ok}}
\newcommand{\IsValue}[1]{{#1}\ \mathsf{value}}

\newcommand{\Integer}{\mathcd{int}}
\newcommand{\Int}{\Integer}
\newcommand{\Numeral}[1]{#1}
\newcommand{\PrimOp}[2]{{#1}({#2})}

\newcommand{\Boolean}{\mathcd{bool}}
\newcommand{\True}{\mathcd{true}}
\newcommand{\False}{\mathcd{false}}
% no type subscript on if
\newcommand{\If}[4]{\mathcd{if}\,{#2}\,\mathcd{then}\,{#3}\,\mathcd{else}\,{#4}\,\mathcd{fi}}
\newcommand{\UIf}[3]{\If{}{#1}{#2}{#3}}

\newcommand{\Function}[2]{{#1}{\to}{#2}}
\newcommand{\PArrow}[2]{{#1}\rightharpoonup{#2}}
\newcommand{\Arrow}[2]{\Function{#1}{#2}}
\newcommand{\Fun}[5]{\mathcd{fun}\,{#3}\,\Dec{\cdparens{\Dec{#4}{#1}}}{#2}\,\mathcd{is}\,{#5}\,\mathcd{end}}
\newcommand{\Fn}[3]{\mathcd{fn}\,\Dec{#1}{#2}\,\mathcd{in}\,{#3}\,\mathcd{end}}
\newcommand{\UFun}[3]{\mathcd{fun}\,{#1}\cdparens{{#2}}\,\mathcd{is}\,{#3}\,\mathcd{end}}
\newcommand{\UFn}[2]{\mathcd{fn}\,{#1}\,\mathcd{in}\,{#2}\,\mathcd{end}}
\newcommand{\Apply}[4]{\mathcd{apply}\cdparens{{#3},{#4}}}
\newcommand{\UApply}[2]{\Apply{}{}{#1}{#2}}
\newcommand{\UApp}[2]{{#1}\cdparens{#2}}
\newcommand{\App}[2]{\UApp{#1}{#2}}

\newcommand{\LetBe}[4]{\mathcd{let}\,\Dec{#2}{#1}\,\mathcd{be}\,{#3}\,\mathcd{in}\,{#4}\,\mathcd{end}}

\newcommand{\FTV}[1]{\mathrm{FTV}(#1)}
\newcommand{\All}[2]{\forall {#1}({#2})}
\newcommand{\PFun}[2]{\mathcd{Fun}\,#1\,\mathcd{in}\,#2\,\mathcd{end}}
\newcommand{\PFn}[2]{\mathcd{Fn}\,#1\,\mathcd{=>}\,#2}
\newcommand{\PLam}[2]{\Lambda\,#1{.}#2}
\newcommand{\PApp}[2]{{#1}\,\cdsqbracks{#2}}
\newcommand{\PApply}[2]{\mathcd{inst}\cdparens{\cdcomma{#1}{#2}}}

\newcommand{\Prod}[2]{{#1}\mathcd{*}{#2}}
\newcommand{\Pair}[2]{\cdparens{\cdcomma{#1}{#2}}}
\newcommand{\Split}[4]{\mathcd{split}\,{#1}\,\mathcd{as}\,\Pair{#2}{#3}\,\mathcd{in}\,{#4}\,\mathcd{end}}
\newcommand{\Fst}[1]{\mathcd{fst}\cdparens{#1}}
\newcommand{\Snd}[1]{\mathcd{snd}\cdparens{#1}}

\newcommand{\Bind}[3]{\mathcd{bind}\,#1\,\mathcd{to}\,#2\,\mathcd{in}\,#3\,\mathcd{end}}

\newcommand{\Void}{\mathcd{void}}

\newcommand{\Sum}[2]{{#1}\mathcd{+}{#2}}
\newcommand{\Inl}[3]{\mathcd{inl}_{\Sum{#1}{#2}}\cdparens{#3}}
\newcommand{\Inr}[3]{\mathcd{inr}_{\Sum{#1}{#2}}\cdparens{#3}}
\newcommand{\Case}[8]{\mathcd{case}_{#1}\,{#2}\,\mathcd{of}\,\mathcd{inl}\cdparens{\Dec{#3}{#4}}\,\mathcd{=>}\,{#5}\,\mathcd{|}\,\mathcd{inr}\cdparens{\Dec{#6}{#7}}\,\mathcd{=>}\,{#8}\,\mathcd{end}}
\newcommand{\UInl}[1]{\mathcd{inl}\cdparens{#1}}
\newcommand{\UInr}[1]{\mathcd{inr}\cdparens{#1}}

\newcommand{\List}[1]{{#1}\,\mathcd{list}}
\newcommand{\IList}{\mathcd{ilist}}
\newcommand{\Nil}{\mathcd{nil}}
\newcommand{\Cons}[2]{\mathcd{cons}\cdparens{{#1},{#2}}}
\newcommand{\Hd}[1]{\mathcd{hd}\cdparens{#1}}
\newcommand{\Tl}[1]{\mathcd{tl}\cdparens{#1}}
\newcommand{\Null}[1]{\mathcd{null}\cdparens{#1}}
\newcommand{\ListCase}[6]{\mathcd{listcase}_{#1}\,{#2}\,\mathcd{of}\,\Nil\,\mathcd{=>}\,#3\,\mathcd{|}\,\Cons{#4}{#5}\,\mathcd{=>}\,#6\,\mathcd{end}}
\newcommand{\UListCase}[5]{\mathcd{listcase}\,{#1}\,\mathcd{of}\,\Nil\,\mathcd{=>}\,{#2}\,\mathcd{|}\,\Cons{#3}{#4}\,\mathcd{=>}\,#5\,\mathcd{end}}

\newcommand{\LList}{\mathcd{llist}}
\newcommand{\LNil}{\mathcd{lnil}}
\newcommand{\LCons}[2]{\mathcd{lcons}\cdparens{\cdcomma{#1}{#2}}}
\newcommand{\LCase}[5]{\mathcd{lcase}\,{#1}\,\mathcd{of}\,\LNil\,\mathcd{=>}\,#2\,\mathcd{|}\,\LCons{#3}{#4}\,\mathcd{=>}\,#5\,\mathcd{end}}
\newcommand{\LIs}[2]{\mathcd{lazy}\,{#1}\,\mathcd{is}\,{#2}}
\newcommand{\BlackHole}{\bullet}

\newcommand{\Error}{\mathcd{error}}
% suppress type argument for now
\newcommand{\RTError}[1]{\mathcd{error}_{}}

\newcommand{\Unit}{\mathcd{unit}}
\newcommand{\UnitEl}{\cdparens{}}
\newcommand{\UnitVal}{\UnitEl}
\newcommand{\UnitCheck}[2]{\mathcd{check}\,#1\,\mathcd{is}\,\UnitVal\,\mathcd{in}\,#2\,\mathcd{end}}

\newcommand{\SubType}{\mathrel{\mathcd{<:}}}
\newcommand{\Float}{\mathcd{float}}
\newcommand{\Long}{\mathcd{long}}
\newcommand{\Tuple}[2]{#2_1\mathcd{*}\cdots\mathcd{*}#2_{#1}}
\newcommand{\TupleExp}[2]{\cdptbracks{\cdseq{#1}{#2}}}
\newcommand{\Record}[3]{\cdbraces{\Dec{{#2}_1}{{#3}_1}\cdcdc\Dec{{#2}_{#1}}{{#3}_{#1}}}}
\newcommand{\RecordExp}[3]{\cdbraces{\Dec{{#2}_1}{{#3}_1}\cdcdc\Dec{{#2}_{#1}}{{#3}_{#1}}}}
\newcommand{\Proj}[2]{{#2}\mathcd{.}{#1}}

\newcommand{\Object}[3]{\mathcd{\{|}\Dec{{#2}_1}{{#3}_1}\cdcdc\Dec{{#2}_{#1}}{{#3}_{#1}}\mathcd{|\}}}
\newcommand{\ObjectExp}[3]{\mathcd{\{|}\Dec{{#2}_1}{{#3}_1}\cdcdc\Dec{{#2}_{#1}}{{#3}_{#1}}\mathcd{|\}}}

\newcommand{\Mu}[2]{\mathcd{rec}\,{#1}\,\mathcd{is}\,{#2}}
\newcommand{\Roll}[2]{\mathcd{roll}\cdparens{#2}}
\newcommand{\Unroll}[1]{\mathcd{unroll}\cdparens{#1}}

\newcommand{\Ref}[1]{{#1}\,\mathcd{ref}}
\newcommand{\New}[1]{\mathcd{ref}\cdparens{#1}}
\newcommand{\Set}[2]{{#1}\mathord{\mathcd{:=}}{#2}}
\newcommand{\Get}[1]{\mathcd{!}{#1}}

\newcommand{\Fail}{\mathcd{fail}}
\newcommand{\Handle}[2]{\mathcd{try}\,{#1}\,\mathcd{ow}\,{#2}}
\newcommand{\Raise}[1]{\mathcd{raise}\cdparens{#1}}
\newcommand{\TryOnly}[1]{\mathcd{try}\,{#1}}

\newcommand{\Cont}[1]{{#1}\,\mathcd{cont}}
\newcommand{\Letcc}[3]{\mathcd{letcc}\,{#2}\,\mathcd{in}\,{#3}}
\newcommand{\Throw}[2]{\mathcd{throw}\,{#1}\,\mathcd{to}\,{#2}}

\newcommand{\Exists}[2]{\exists {#1}(#2)}
\newcommand{\Pack}[3]{\mathcd{pack}\,{#1}\,\mathcd{with}\,{#2}\,\mathcd{as}\,{#3}\,\mathcd{end}}
\newcommand{\Open}[5]{\mathcd{open}\,{#1}\,\mathcd{as}\,{#2}\,\mathcd{with}\,\Dec{#3}{#4}\,\mathcd{in}\,{#5}\,\mathcd{end}}

\newcommand{\Letchan}[2]{\mathcd{letchan}\,#1\,\mathcd{in}\,#2\,\mathcd{end}}
\newcommand{\Thread}[2]{#1\mathcd{:}#2}
\newcommand{\Spawn}[1]{\mathcd{spawn}\cdparens{#1}}
\newcommand{\Wait}[1]{\mathcd{wait}\cdparens{#1}}
\newcommand{\Exit}{\mathcd{exit}\cdparens}
\newcommand{\Channel}{\mathcd{channel}\cdparens{}}
\newcommand{\Sync}[1]{\mathcd{sync}\cdparens{#1}}
\newcommand{\Wrap}[2]{\mathcd{wrap}\cdparens{\cdcomma{#1}{#2}}}
\newcommand{\Guard}[1]{\mathcd{guard}\cdparens{#1}}
\newcommand{\RecvEvt}[1]{\mathcd{recv}\cdparens{#1}}
\newcommand{\SendEvt}[2]{\mathcd{send}\cdparens{\cdcomma{#1}{#2}}}
\newcommand{\Always}{\mathcd{always}}
\newcommand{\Never}{\mathcd{never}}
\newcommand{\Choose}[2]{\mathcd{choose}\cdparens{\cdcomma{#1}{#2}}}

\newcommand{\Delayed}[1]{{#1}\,\mathcd{computation}}
\newcommand{\Delay}[2]{\mathcd{delay}\,{#1}\,\mathcd{is}\,{#2}}
\newcommand{\ForceIn}[3]{\mathcd{eval}\,{#2}\,\mathcd{as}\,{#1}\,\mathcd{in}\,{#3}\,\mathcd{end}}

\newcommand{\LetRec}[3]{\mathcd{rec}\,\Dec{#1}{#2}\,\mathcd{is}\,{#3}}

\newcommand{\MCast}[2]{(#2)\,{#1}}

\newcommand{\WRONG}{\mathsf{wrong}}
\newcommand{\OK}[1]{\mathop{\mathsf{ok}}(#1)}

\newcommand{\CostEvalsTo}[3]{#1\Downarrow^{#3} #2}

\newcommand{\EqvExp}[2]{{#1}\cong_\textit{exp}{#2}}
\newcommand{\EqvVal}[2]{{#1}\cong_\textit{val}{#2}}

\newcommand{\String}{\mathcd{string}}

\newcommand{\Array}[1]{{#1}\,\mathcd{array}}
\newcommand{\ArrGet}[2]{{#1}\cdsqbracks{#2}}
\newcommand{\ArrSet}[3]{{#1}\cdsqbracks{#2}\mathcd{:=}{#3}}

\newcommand{\ToFloat}{\mathcd{to\_float}}

\newcommand{\Yields}{\mathrel{\leadsto}}
\newcommand{\Identity}[1]{\mathcd{id}_{#1}}
\newcommand{\Compose}[2]{{#1}\mathcd{;}{#2}}

\newcommand{\Drop}[4]{\mathcd{drop}_{#1,#2,#3,#4}}
\newcommand{\Copy}[4]{\mathcd{copy}_{#1,#2,#3,#4}}

\newcommand{\Vec}[1]{{#1}\,\mathcd{vector}}
\newcommand{\Vector}[1]{\cdsqbracks{#1}}
\newcommand{\VecElt}[2]{\mathcd{elt}\cdparens{\cdcomma{#1}{#2}}}
\newcommand{\VecSize}[1]{\mathcd{size}\cdparens{#1}}
\newcommand{\VecIndex}[1]{\mathcd{index}\cdparens{#1}}
\newcommand{\VecUpdate}[2]{\mathcd{update}\cdparens{\cdcomma{#1}{#2}}}
\newcommand{\VecMap}[2]{\mathcd{map}\cdparens{\cdcomma{#1}{#2}}}

\newcommand{\ThreeProd}[3]{{#1}\mathcd{*}{#2}\mathcd{*}{#3}}
\newcommand{\Triple}[3]{\cdparens{#1\mathcd{,}#2\mathcd{,}#3}}


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
