<div dir="ltr">That seems like a good idea!<div><br></div><div>Can you make a feature request at <a href="https://gitlab.haskell.org/ghc/ghc/issues">https://gitlab.haskell.org/ghc/ghc/issues</a> and maybe even an merge request?</div><div><br></div><div>Cheers,</div><div>Simonx</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Di., 8. Okt. 2019 um 11:09 Uhr schrieb Dannyu NDos <<a href="mailto:ndospark320@gmail.com">ndospark320@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">I don't know exact sementics of Storable, but it's addable anyway.<div dir="auto"><br></div><div dir="auto"><pre><span style="color:rgb(175,0,95)">instance</span> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#Storable" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(95,95,175)">Storable</span></a> <font color="#5f5faf">Ordering</font> <span style="color:rgb(175,0,95)">where</span>
<a name="m_56142532315285505_m_-2683064632936383029_line-159" rel="noreferrer"></a>   <a name="m_56142532315285505_m_-2683064632936383029_local-8214565720323872799" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#sizeOf" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">sizeOf</span></a> <span style="color:rgb(7,54,66)">_</span>          <span style="color:rgb(220,50,47)">=</span> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#sizeOf" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">sizeOf</span></a> <span style="color:rgb(220,50,47)">(</span><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Err.html#undefined" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">undefined</span></a><span style="color:rgb(220,50,47)">::</span><span style="color:rgb(7,54,66)">HTYPE_INT</span><span style="color:rgb(220,50,47)">)</span>
<a name="m_56142532315285505_m_-2683064632936383029_line-160" rel="noreferrer"></a>   <a name="m_56142532315285505_m_-2683064632936383029_local-8214565720323872800" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#alignment" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">alignment</span></a> <span style="color:rgb(7,54,66)">_</span>       <span style="color:rgb(220,50,47)">=</span> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#alignment" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">alignment</span></a> <span style="color:rgb(220,50,47)">(</span><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Err.html#undefined" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">undefined</span></a><span style="color:rgb(220,50,47)">::</span><span style="color:rgb(7,54,66)">HTYPE_INT</span><span style="color:rgb(220,50,47)">)</span>
<a name="m_56142532315285505_m_-2683064632936383029_line-161" rel="noreferrer"></a>   <a name="m_56142532315285505_m_-2683064632936383029_local-8214565720323872801" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#peekElemOff" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">peekElemOff</span></a> <a name="m_56142532315285505_m_-2683064632936383029_local-6989586621679097926" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097926" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">p</span></a> <a name="m_56142532315285505_m_-2683064632936383029_local-6989586621679097927" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097927" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">i</span></a>   <span style="color:rgb(220,50,47)">=</span> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Base.html#liftM" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">liftM</span></a> <span style="color:rgb(220,50,47)">(</span><font color="#d33682">`compare`</font> <span style="color:rgb(220,50,47)">(</span><font color="#268bd2">1</font><span style="color:rgb(220,50,47)">::</span><span style="color:rgb(7,54,66)">HTYPE_INT</span><span style="color:rgb(220,50,47)">)</span><span style="color:rgb(220,50,47)">)</span> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#peekElemOff" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(211,54,130)">$</span></a> <span style="color:rgb(7,54,66)">peekElemOff</span> <span style="color:rgb(220,50,47)">(</span><span style="color:rgb(7,54,66)">castPtr</span> <span style="color:rgb(7,54,66)">p</span><span style="color:rgb(220,50,47)">)</span> <span style="color:rgb(7,54,66)">i</span>
<a name="m_56142532315285505_m_-2683064632936383029_line-162" rel="noreferrer"></a>   <a name="m_56142532315285505_m_-2683064632936383029_local-8214565720323872802" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#pokeElemOff" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">pokeElemOff</span></a> <a name="m_56142532315285505_m_-2683064632936383029_local-6989586621679097928" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097928" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">p</span></a> <a name="m_56142532315285505_m_-2683064632936383029_local-6989586621679097929" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097929" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">i</span></a> <a name="m_56142532315285505_m_-2683064632936383029_local-6989586621679097930" rel="noreferrer"></a><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097930" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">x</span></a> <span style="color:rgb(220,50,47)">=</span> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#pokeElemOff" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">pokeElemOff</span></a> <span style="color:rgb(220,50,47)">(</span><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Ptr.html#castPtr" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">castPtr</span></a> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097928" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">p</span></a><span style="color:rgb(220,50,47)">)</span> <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097929" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank"><span style="color:rgb(7,54,66)">i</span></a> <span style="color:rgb(220,50,47)">(</span><font color="#af005f">fromIntegral</font> (fromEnum <span style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213);color:rgb(7,54,66)"><a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097930" style="text-decoration-line:none;border-bottom:1px solid rgb(238,232,213)" rel="noreferrer" target="_blank">x</a>)</span><span style="color:rgb(220,50,47)">::</span><span style="color:rgb(7,54,66)">HTYPE_INT</span><span style="color:rgb(220,50,47)">)</span></pre></div></div>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>