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@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries