title: Why remote tables and StaticLabels are still used in CloudHaskell?
body: <p>I'm reading the source code of <code>distributed-process</code> and related packages.
  In <code>distributed-static</code> we have the definition of <code>StaticLabel</code>:</p>
  
  <pre><code>data StaticLabel =
      StaticLabel String
    | StaticApply !StaticLabel !StaticLabel
    | StaticPtr SDynamic
    deriving (Eq, Ord, Typeable, Show)
  </code></pre>
  
  <p>Which is then used to define <code>Static</code> as a newtype wrapper around
  <code>StaticLabel</code> with a phantom variable attached for type safety:</p>
  
  <pre><code>newtype Static a = Static StaticLabel
    deriving (Eq, Ord, Typeable, Show)
  </code></pre>
  
  <p>I have no questions about <code>StaticApply</code>, it just lumps together two static
  values. However, <code>StaticLabel</code> and <code>StaticPtr</code> seem to achieve the same goal
  in different ways.</p>
  
  <p>If we go with <code>StaticLabel</code> we just have/transimt a <code>String</code> label which
  then can be used to lookup a <code>Dynamic</code> value from <code>RemoteTable</code>:</p>
  
  <pre><code>newtype RemoteTable = RemoteTable (Map String Dynamic)
  </code></pre>
  
  <p>Where <code>Dynamic</code> is (defined in <code>rank1dynamic</code>):</p>
  
  <pre><code>data Dynamic = Dynamic TypeRep GHC.Any
  </code></pre>
  
  <p>Which is almost the same as <code>SDynamic</code> contained in <code>StaticPtr</code>:</p>
  
  <pre><code>data SDynamic = SDynamic TypeRep (StaticPtr GHC.Any)
  </code></pre>
  
  <p>The difference being, with <code>Dynamic</code> we have <code>GHC.Any</code> without indirection,
  with <code>SDynamic</code> we must lookup the value. The result is the same: we receive
  that <code>Any</code> value which we can <code>unsafeCoerce</code> if the target <code>TypeRep</code> is
  <a href="https://hackage.haskell.org/package/rank1dynamic-0.4.0/docs/Data-Rank1Typeable.html#v:isInstanceOf" rel="noreferrer"><code>instanceOf</code></a>
  of the <code>TypeRep</code> we store in <code>SDynamic</code> or <code>Dynamic</code>.</p>
  
  <p>Management of remote tables, although automated to some extent via TH, is
  still kind of annoying, so why not use just <code>StaticPtr</code>s? Does <code>StaticLabel</code>
  exist only for backward compatibility with older GHCs or am I missing
  something?</p>