<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Cafe,<div class=""><br class=""></div><div class="">I believe there should exist some trick that I haven't learned, to have this compile:</div><div class=""><br class=""></div><div class=""><div style="color: rgb(212, 190, 152); background-color: rgb(23, 24, 24); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre;" class=""><div class=""><span style="color: #cc524b;" class="">module</span><span style="color: #73a36c;" class=""> PoC.Existential </span><span style="color: #cc524b;" class="">where</span></div><br class=""><div class=""><span style="color: #cc524b;" class="">import</span><span style="color: #73a36c;" class=""> Data.Dynamic</span></div><div class=""><span style="color: #cc524b;" class="">import</span><span style="color: #73a36c;" class=""> </span><span style="color: #cc524b;" class="">qualified</span><span style="color: #73a36c;" class=""> Data.Vector.Storable </span><span style="color: #cc524b;" class="">as</span><span style="color: #73a36c;" class=""> VS</span></div><div class=""><span style="color: #cc524b;" class="">import</span><span style="color: #73a36c;" class=""> Foreign</span></div><div class=""><span style="color: #cc524b;" class="">import</span><span style="color: #73a36c;" class=""> Prelude</span></div><br class=""><div class=""><span style="color: #7e6b5f;" class="">-- * Necessary artifacts</span></div><br class=""><div class=""><span style="color: #cc524b;" class="">data</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">Series</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">Series</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">{</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">seriesLen</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">IO</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">Int</span>,</div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">readSeries</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">Int</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">-></span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">IO</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">}</span></div><br class=""><div class=""><span style="color: #cc524b;" class="">data</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">SomeArray</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-style: italic;" class="">forall</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span><span style="color: #cc524b;font-weight: bold;" class="">.</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span>(<span style="color: #6b95c5;" class="">Typeable</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span>,<span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #6b95c5;" class="">Storable</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=></span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">SomeArray</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">{</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">arrayCap</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">Int</span>,</div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">arrayPtr</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">ForeignPtr</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">}</span></div><br class=""><div class=""><span style="color: #cc524b;" class="">class</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">ManagedArray</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">t</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">where</span></div><div class=""><span style="color: #96b946;" class=""> </span><span style="color: #66a89d;" class="">arrayAtTheMoment</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #96b946;" class=""> </span><span style="color: #82aed8;" class="">t</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">-></span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">IO</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">SomeArray</span></div><br class=""><div class=""><span style="color: #cc524b;" class="">data</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">SomeManagedArray</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-style: italic;" class="">forall</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">t</span><span style="color: #cc524b;font-weight: bold;" class="">.</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span>(<span style="color: #6b95c5;" class="">Typeable</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">t</span>,<span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">ManagedArray</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">t</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=></span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">SomeManagedArray</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">t</span></div><div class=""><br class=""></div></div></div><div class=""><br class=""></div><div class="">In following, I can confirm it works with the nested `do` block flattened (as shown later), but I really need it in the more complex real case, so please bear with me.</div><div class=""><br class=""></div><div class=""><div style="color: rgb(212, 190, 152); background-color: rgb(23, 24, 24); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre;" class=""><br class=""><div class=""><span style="color: #7e6b5f;" class="">-- * Things not working</span></div><br class=""><div class=""><span style="color: #66a89d;" class="">managedArrayAsSeries</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">SomeManagedArray</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">-></span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">IO</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">Dynamic</span></div><div class=""><span style="color: #d4bfa0;" class="">managedArrayAsSeries </span>(<span style="color: #cca143;" class="">SomeManagedArray</span><span style="color: #d4bfa0;" class=""> ma</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">do</span></div><div class=""><span style="color: #d4bfa0;" class=""> vec </span><span style="color: #cc524b;font-weight: bold;" class=""><-</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">do</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">SomeArray</span><span style="color: #d4bfa0;" class=""> cap fp </span><span style="color: #cc524b;font-weight: bold;" class=""><-</span><span style="color: #d4bfa0;" class=""> arrayAtTheMoment ma</span></div><div class=""><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">unsafeFromForeignPtr0 fp cap</span></div><br class=""><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">let</span><span style="color: #d4bfa0;" class=""> len </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">length vec</span></div><div class=""><span style="color: #d4bfa0;" class=""> rs i </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> vec </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #a3d349;" class="">!</span><span style="color: #d4bfa0;" class=""> i</span></div><div class=""><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> toDyn </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">Series</span><span style="color: #d4bfa0;" class=""> len rs</span></div><br class=""></div></div><div class=""><br class=""></div><div class="">The error:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(152, 244, 245); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">src/PoC/Existential.hs:36:5: </b></span><span style="font-variant-ligatures: no-common-ligatures; color: #fc3522" class=""><b class="">error:</b></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> • Couldn't match type ‘a’ with ‘a0’</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> ‘a’ is a rigid type variable bound by</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> a pattern with constructor:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> SomeArray :: forall a.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> (Typeable a, Storable a) =></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Int -> ForeignPtr a -> SomeArray,</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> in a pattern binding in</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> a 'do' block</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> at src/PoC/Existential.hs:35:5-20</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Expected type: IO (VS.Vector a0)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Actual type: IO (VS.Vector a)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> • In a stmt of a 'do' block:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> return $ VS.unsafeFromForeignPtr0 fp cap</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> In a stmt of a 'do' block:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> vec <- do SomeArray cap fp <- arrayAtTheMoment ma</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> return $ VS.unsafeFromForeignPtr0 fp cap</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> In the expression:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> do vec <- do SomeArray cap fp <- arrayAtTheMoment ma</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> return $ VS.unsafeFromForeignPtr0 fp cap</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> let len = return $ VS.length vec</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> rs i = return $ vec VS.! i</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> return $ toDyn $ Series len rs</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> • Relevant bindings include</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> fp :: ForeignPtr a (bound at src/PoC/Existential.hs:35:19)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(207, 125, 255); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><b class=""> |</b></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(252, 53, 34); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #cf7dff" class=""><b class="">36 |</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #74e5ca" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">return $ VS.unsafeFromForeignPtr0 fp cap</b></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(252, 53, 34); background-color: rgb(22, 27, 24);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #cf7dff" class=""><b class=""> |</b></span><span style="font-variant-ligatures: no-common-ligatures" class=""><b class=""> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</b></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(116, 229, 202); background-color: rgb(22, 27, 24); min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div></div><div class=""><br class=""></div><div class="">While these more trivial things work as expected:</div><div class=""><br class=""></div><div class=""><div style="color: rgb(212, 190, 152); background-color: rgb(23, 24, 24); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre;" class=""><br class=""><div class=""><span style="color: #7e6b5f;" class="">-- * Things working</span></div><br class=""><div class=""><span style="color: #66a89d;" class="">managedArrayAsSeries'</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">SomeManagedArray</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">-></span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">IO</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">Dynamic</span></div><div class=""><span style="color: #d4bfa0;" class="">managedArrayAsSeries' </span>(<span style="color: #cca143;" class="">SomeManagedArray</span><span style="color: #d4bfa0;" class=""> ma</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">do</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">SomeArray</span><span style="color: #d4bfa0;" class=""> cap fp </span><span style="color: #cc524b;font-weight: bold;" class=""><-</span><span style="color: #d4bfa0;" class=""> arrayAtTheMoment ma</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">let</span><span style="color: #d4bfa0;" class=""> vec </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">unsafeFromForeignPtr0 fp cap</span></div><br class=""><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">let</span><span style="color: #d4bfa0;" class=""> len </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">length vec</span></div><div class=""><span style="color: #d4bfa0;" class=""> rs i </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> vec </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #a3d349;" class="">!</span><span style="color: #d4bfa0;" class=""> i</span></div><div class=""><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> toDyn </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">Series</span><span style="color: #d4bfa0;" class=""> len rs</span></div><br class=""><div class=""><span style="color: #66a89d;" class="">arrayAsSeries</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">SomeArray</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">-></span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">Dynamic</span></div><div class=""><span style="color: #d4bfa0;" class="">arrayAsSeries </span>(<span style="color: #cca143;" class="">SomeArray</span><span style="color: #d4bfa0;" class=""> cap fp</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span></div><div class=""><span style="color: #d4bfa0;" class=""> colAsSeries </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">SomeColumn</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">unsafeFromForeignPtr0 fp cap</span></div><br class=""><div class=""><span style="color: #66a89d;" class="">arrayAsSeries'</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">SomeArray</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">-></span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">Dynamic</span></div><div class=""><span style="color: #d4bfa0;" class="">arrayAsSeries' </span>(<span style="color: #cca143;" class="">SomeArray</span><span style="color: #d4bfa0;" class=""> cap fp</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">do</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">let</span><span style="color: #d4bfa0;" class=""> vec </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">unsafeFromForeignPtr0 fp cap</span></div><div class=""><span style="color: #d4bfa0;" class=""> len </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">length vec</span></div><div class=""><span style="color: #d4bfa0;" class=""> rs i </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> vec </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #a3d349;" class="">!</span><span style="color: #d4bfa0;" class=""> i</span></div><div class=""><span style="color: #d4bfa0;" class=""> toDyn </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">Series</span><span style="color: #d4bfa0;" class=""> len rs</span></div><br class=""><div class=""><span style="color: #cc524b;" class="">data</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #6b95c5;" class="">SomeColumn</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-style: italic;" class="">forall</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span><span style="color: #cc524b;font-weight: bold;" class="">.</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span>(<span style="color: #6b95c5;" class="">Typeable</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span>,<span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #6b95c5;" class="">Storable</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=></span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">SomeColumn</span><span style="color: #d4bfa0;" class=""> </span>(<span style="color: #73a36c;" class="">VS.</span><span style="color: #6b95c5;" class="">Vector</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #82aed8;" class="">a</span>)</div><br class=""><div class=""><span style="color: #66a89d;" class="">colAsSeries</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">::</span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">SomeColumn</span><span style="color: #96b946;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">-></span><span style="color: #96b946;" class=""> </span><span style="color: #6b95c5;" class="">Dynamic</span></div><div class=""><span style="color: #d4bfa0;" class="">colAsSeries </span>(<span style="color: #cca143;" class="">SomeColumn</span><span style="color: #d4bfa0;" class=""> colVec</span>)<span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> toDyn </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #cca143;" class="">Series</span><span style="color: #d4bfa0;" class=""> len rs</span></div><div class=""><span style="color: #d4bfa0;" class=""> </span><span style="color: #cc524b;" class="">where</span></div><div class=""><span style="color: #d4bfa0;" class=""> len </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #d4bfa0;" class="">length colVec</span></div><div class=""><span style="color: #d4bfa0;" class=""> rs i </span><span style="color: #cc524b;font-weight: bold;" class="">=</span><span style="color: #d4bfa0;" class=""> return </span><span style="color: #a3d349;" class="">$</span><span style="color: #d4bfa0;" class=""> colVec </span><span style="color: #73a36c;" class="">VS.</span><span style="color: #a3d349;" class="">!</span><span style="color: #d4bfa0;" class=""> i</span></div><br class=""></div></div><div class=""><br class=""></div><div class="">Please teach me the trick!</div><div class=""><br class=""></div><div class="">Thanks with regards,</div><div class="">Compl</div><div class=""><br class=""></div></body></html>