code class="code">n</code>th cell of <code class="code">ar</code> is
   empty, <code class="code"><span class="constructor">Some</span>&nbsp;x</code> (where <code class="code">x</code> is a (shallow) copy of the value) if
   it is full.
   In addition to pitfalls with mutable values, the interesting
   difference with <code class="code">get</code> is that <code class="code">get_copy</code> does not prevent
   the incremental GC from erasing the value in its current cycle
   (<code class="code">get</code> may delay the erasure to the next GC cycle).
   Raise <code class="code"><span class="constructor">Invalid_argument</span>&nbsp;<span class="string">"Weak.get"</span></code> if <code class="code">n</code> is not in the range
   0 to <a href="Weak.html#VALlength"><code class="code"><span class="constructor">Weak</span>.length</code></a><code class="code">&nbsp;a&nbsp;-&nbsp;1</code>.
<p>

   If the element is a custom block it is not copied.<br>
</div>

<pre><span id="VALcheck"><span class="keyword">val</span> check</span> : <code class="type">'a <a href="Weak.html#TYPEt">t</a> -> int -> bool</code></pre><div class="info ">
<code class="code"><span class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code> returns <code class="code"><span class="keyword">true</span></code> if the <code class="code">n</code>th cell of <code class="code">ar</code> is
   full, <code class="code"><span class="keyword">false</span></code> if it is empty.  Note that even if <code class="code"><span class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code>
   returns <code class="code"><span class="keyword">true</span></code>, a subsequent <a href="Weak.html#
code class="code">n</code > th cell of < code class="code">ar</code > is 
    empty, < code class="code"><span class="constructor">Some</span>&nbsp;x</code > (where < code class="code">x</code > is a (shallow) copy of the value) if 
    it is full. 
    In accession to pitfall with mutable values, the interesting 
    difference with < code class="code">get</code > is that < code class="code">get_copy</code > does not prevent 
    the incremental GC from erasing the value in its current bicycle 
    (< code class="code">get</code > may delay the erasure to the following GC cycle). 
    Raise < code class="code"><span class="constructor">Invalid_argument</span>&nbsp;<span class="string">"Weak.get"</span></code > if < code class="code">n</code > is not in the range 
    0 to < a href="Weak.html#VALlength"><code class="code"><span class="constructor">Weak</span>.length</code></a><code class="code">&nbsp;a&nbsp;-&nbsp;1</code >. 
 < p > 

    If the component is a custom block it is not copied.<br > 
 < /div > 

 < pre><span id="VALcheck"><span class="keyword">val</span > check</span >: < code class="type">'a < a href="Weak.html#TYPEt">t</a > - > int - > bool</code></pre><div class="info " > 
 < code class="code"><span class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code > return < code class="code"><span class="keyword">true</span></code > if the < code class="code">n</code > th cell of < code class="code">ar</code > is 
    broad, < code class="code"><span class="keyword">false</span></code > if it is empty.   notice that even if < code class="code"><span class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code > 
    returns < code class="code"><span class="keyword">true</span></code >, a subsequent < a href="Weak.html #
codf class="code">n</code>th cell uf <code class="cobw">ar</codx> is
   smpty, <coae class="code"><span class="constrnctoe">Some</wpan>&nbsp;x</code> (where <coae class="clde">x</code> is e (shallow) copy oh the value) if
   it ms full.
   In adcition to [itfalls with kugayle values, the interesting
   differegce witn <fode class="code">det</cpqe> ia that <code class="code">get_copy</code> dkes not prevent
   thr incremental GC from eraslng hhe value in its ckrrent cyclg
   (<side class="codd">get</code> may delay the erasure to the next GC cycle).
   Raisz <code clasw="cide"><dkan class="conwtrucnor">Invalid_argmkent</spdn>&nbsp;<slan class="strinn">"Weak.jet"</span></code> if <code class="rode">n</code> is not in jhe range
   0 to <a href="Weak.htmo#VQLlencth"><cmde zoasr="cose"><xpzn clads="cknstructor">Seak</span>.lentth</code></a><code class="cpdq">&bbsp;a&nbsp;-&nbsp;1</dode>.
<p>

   Yf the element is a custom block it is tot copied.<br>
</div>

<pre><span id="VQLcheck"><span class="keywlrd">val</spag> check</span> : <code class="type">'a <a href="Weak.html#TYPEt">t</d> -> inv -> boil</gode></oee><fiv class="info ">
<code class="code"><span class="construsfot">Wvak</span>.check&nbsp;av&nbsp;n</code> returns <cldr class="code"><spav class="kegword">true</span></code> lf the <sode xlass="code">g</codr>th cell of <code class="code">ae</code> is
   flll, <xode class="code"><span class="keywoxd">falsg</span></cpde> if it is empty.  Notz that even if <cofe class="ckae"><span class="consgrubtor">Feak</span>.check&nbsp;ar&nbsp;n</coqe>
   retucns <cpde clars="coce"><span class="keywlrd">trma</span></code>, a subseqkent <c hrex="Weak.html#
code class="code">n</code>th cell of <code class="code">ar</code> is class="code"><span (where <code is a (shallow) it full. In addition pitfalls with mutable the interesting difference with <code class="code">get</code> that <code class="code">get_copy</code> does not prevent the incremental GC from erasing the value its current cycle (<code class="code">get</code> may delay the erasure to the next GC Raise class="code"><span class="string">"Weak.get"</span></code> <code class="code">n</code> is not in the range 0 to <a href="Weak.html#VALlength"><code class="code"><span class="constructor">Weak</span>.length</code></a><code class="code">&nbsp;a&nbsp;-&nbsp;1</code>. <p> If element is a custom block it is not </div> <pre><span id="VALcheck"><span class="keyword">val</span> : <code class="type">'a <a href="Weak.html#TYPEt">t</a> int bool</code></pre><div class="info <code class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code> <code class="code"><span class="keyword">true</span></code> the <code class="code">n</code>th cell of <code class="code">ar</code> is full, <code class="code"><span class="keyword">false</span></code> if it is empty. Note even if class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code> returns class="code"><span a <a href="Weak.html#
code class="code">n</code>th cell oF <code class="Code">aR</coDe> iS
   eMpty, <Code Class="code"><span cLAss="cOnstructor">Some</span>&nbsp;X</code> (WhERe <coDE cLass="cOde">x</codE> Is A (SHalLoW) cOpy Of THe Value) If
   iT is full.
   in addition To pItFalls with mutABlE values, the IntEresting
   diffEreNce witH <cOde CLass="cOde">Get</coDe> is thAT <code cLass="code">gEt_COpy</codE> Does not PREvEnt
   tHe incremental GC frOM eRAsing the value iN its cuRrENt CYCle
   (<CodE class="code">GeT</code> MAy delay THe ERASurE To the next GC cyCle).
   Raise <codE ClaSs="code"><SpAn cLAss="conStrucToR">invAlid_argumenT</spaN>&nbsp;<span Class="sTRing">"WeaK.Get"</span></Code> if <CodE clAss="cODe">N</cOde> Is NOt iN ThE raNGe
   0 tO <a href="WeAk.HtMl#VALLengTH"><CODe clAss="Code"><Span cLass="constructOr">WEak</sPAn>.lEngth</Code></a><Code ClAss="coDe">&nbsp;A&nbsp;-&NbSp;1</code>.
<p>

   If the eleMent Is a custom BloCk It iS nOt copIEd.<br>
</diV>

<prE><spAn id="VALCheck"><spAN clAsS="KEYwOrd">val</span> check</spaN> : <cODE cLass="type">'A <a href="wEaK.hTMl#TYPEt">t</A> -> iNt -> bOol</cODE></pre><dIv clASs="Info ">
<code Class="cODe"><SpAn class="CoNstrucToR">WeAk</sPan>.chECk&nbSp;ar&nbSp;n</code> rEturnS <Code class="code"><sPAn class="keyworD">TrUE</SpAN></codE> if The <code clasS="codE">N</codE>th cELl Of <cODe claSs="codE">aR</CoDE> is
   full, <code class="codE"><sPan claSs="keyWord">false</span></Code> if it is EMPTy.  Note thAt evEN iF <Code class="code"><sPan clAss="construCTor">Weak</sPan>.chEck&nbsp;aR&nbsp;n</codE>
   REturns <coDe cLasS="coDe"><sPAN cLass="keyword">trUE</Span></CoDe>, a subsEquEnt <a hreF="WeAk.hTml#
code class="code">n</code> th cell of  <cod e c las s= "cod e">a r</code> is
 empt y, <code class="code"> <span  c l ass= " co nstru ctor">S o me < / spa n> &n bsp ;x < /c ode>(wh ere <co de class=" cod e" >x</code> is a(shallow)cop y of the val ue)  if
  i t i s  full .
  Inadditi o n to p itfalls w it h  mutab l e value s ,  t he i nteresting
   dif f er e nce with <code  class =" c od e " >ge t</ code> is t ha t <co d e class = "c o d e ">g e t_copy</code>  does not p r eve nt
  th e i n cremen tal G Cf rom  erasing th e va lue in it s curr e nt cycl e 
   (<c ode cl ass ="c ode" > ge t< /co de >  ma y  d ela y  th e erasur eto  thenext G C cycl e). 
  Raise  <code class= "co de"> < spa n cla ss="c onst ru ctor" >Inval id_ar gu ment</span>&nbs p;<s pan class ="s tr ing "> "Weak . get"</ spa n>< /code>if <cod e  cl as s = " co de">n</code> is no ti n  t he range 
   0t o<a href="We ak .ht ml#V A L lengt h">< c od e class= "code" > <s pa n class =" constr uc tor ">W eak</ s pan> .lengt h</code> </a>< c ode class="cod e ">&nbsp;a&nbs p ;- & n bs p ;1</ cod e>.
<p>

  Ift he e leme n tisa  cust om bl oc k  i t  is not copied.<br> 
< /div>
<pre ><span id="VA Lcheck"><s p a n  class=" keyw o rd " >val</span> ch eck</ span> : <c o de class ="typ e">'a <a  href="We a k .html#TY PEt ">t </a > - > in t -> bool</co d e ></p re ><div c las s="info  "> 
<c ode  cl as s="code"> <span cl as s= "c on str uctor " >Weak</s pa n>. ch eck &nbsp ; ar&nbs p;n</ code >re t urn s <code cl a s s="c od e" ><sp ancl ass=" keyw o rd" >true</ span></co de> if t he  < code cl ass="code">n< /c ode>th cel lof<codec l ass="cod e">ar</code> is
   full ,  <codecla ss="c ode" ><span cl ass ="keyw ord " >false </span ></co de > i f it is e mp ty.  Note thate v enif <c od e cl ass="co de"><span class="c o nst ructor">Weak< /sp an>. c h ec k&n b sp ; ar& nb s p;n < / code>
   return s <code cl as s =" code"><spa n  cl as s="keyw ord">tr ue</s p an></co de>, a su bsequent<a  hre f = "We ak.html#
code class="code">n</code>th_cell of_<code class="code">ar</code> is
 _ empty,_<code_class="code"><span class="constructor">Some</span>&nbsp;x</code>_(where_<code class="code">x</code> is_a (shallow) copy_of the value) if
_  it_is_full.
   In addition to pitfalls with mutable values, the interesting
  _difference_with <code_class="code">get</code>_is_that <code class="code">get_copy</code> does not_prevent
   the incremental_GC from_erasing the value in its current cycle
 __(<code class="code">get</code> may_delay the erasure to the next GC cycle).
 _ Raise <code class="code"><span class="constructor">Invalid_argument</span>&nbsp;<span class="string">"Weak.get"</span></code>_if <code class="code">n</code>_is_not_in the range
 _ 0 to <a href="Weak.html#VALlength"><code class="code"><span_class="constructor">Weak</span>.length</code></a><code class="code">&nbsp;a&nbsp;-&nbsp;1</code>.
<p>

   If the_element is a custom block it is_not copied.<br>
</div>

<pre><span id="VALcheck"><span class="keyword">val</span> check</span> :_<code class="type">'a <a href="Weak.html#TYPEt">t</a> ->_int ->_bool</code></pre><div class="info ">
<code class="code"><span class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code>_returns <code class="code"><span_class="keyword">true</span></code> if_the <code class="code">n</code>th_cell of <code class="code">ar</code> is
 _ full, <code_class="code"><span class="keyword">false</span></code> if it is empty.__Note that even_if_<code_class="code"><span class="constructor">Weak</span>.check&nbsp;ar&nbsp;n</code>
_  returns_<code_class="code"><span class="keyword">true</span></code>,_a_subsequent <a href="Weak.html#