Add instance Storable Ordering

Vanessa McHale vamchale at gmail.com
Tue Oct 8 14:40:27 UTC 2019


I would appreciate this too

On 10/8/19 4:08 AM, Dannyu NDos wrote:
> I don't know exact sementics of Storable, but it's addable anyway.
>
> instance Storable <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#Storable> Ordering where
>    sizeOf <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#sizeOf> _          = sizeOf <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#sizeOf> (undefined <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Err.html#undefined>::HTYPE_INT)
>    alignment <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#alignment> _       = alignment <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#alignment> (undefined <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Err.html#undefined>::HTYPE_INT)
>    peekElemOff <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#peekElemOff> p <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097926> i <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097927>   = liftM <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Base.html#liftM> (`compare` (1::HTYPE_INT)) $ <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#peekElemOff> peekElemOff (castPtr p) i
>    pokeElemOff <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#pokeElemOff> p <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097928> i <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097929> x <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097930> = pokeElemOff <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#pokeElemOff> (castPtr <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.Ptr.html#castPtr> p <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097928>) i <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097929> (fromIntegral (fromEnum x
> <http://hackage.haskell.org/package/base-4.12.0.0/docs/src/Foreign.Storable.html#local-6989586621679097930>)::HTYPE_INT)
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20191008/1e77eca4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20191008/1e77eca4/attachment.sig>


More information about the Libraries mailing list