-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Type-checked pointer diffs -- -- Type-checked pointer diffs. @package ptrdiff @version 0 module Foreign.Ptr.Diff -- | So long as minusPtr returns an Int, we're stuck with -- size of Int = size of ptrdiff_t newtype Diff a b Diff :: Int -> Diff a b [getDiff] :: Diff a b -> Int -- | Invert a pointer Diff, e.g. convert a pointer to a field member -- to one that computes the location of the parent, or one that computes -- the offset of the next item into one that computes the offset of the -- previous element. inv :: Diff a b -> Diff b a -- | Calculate the position of the next elment of a given type when they -- are packed in densely. next :: forall a. Storable a => Diff a a -- | Calculate the position of the previous element of a given type when -- they are packed in densely. prev :: Storable a => Diff a a -- | Diff is a groupoid, so Diff a a is a group, and as -- such it forms a module over the integers (.*) :: Int -> Diff a a -> Diff a a infixr 6 .* -- | Advance n (possibly negative) items in a dense packing. advance :: Storable a => Int -> Diff a a class DiffTorsor t act :: DiffTorsor t => Diff a b -> t a -> t b diff :: DiffTorsor t => t b -> t a -> Diff a b -- | peek using a Diff between pointers to calculate the -- offset. peekDiffOff :: (MonadIO m, Storable b) => Ptr a -> Diff a b -> m b -- | poke using a Diff between pointers to calculate the -- offset. pokeDiffOff :: (MonadIO m, Storable b) => Ptr a -> Diff a b -> b -> m () instance GHC.Generics.Generic (Foreign.Ptr.Diff.Diff a b) instance (Data.Data.Data a, Data.Data.Data b) => Data.Data.Data (Foreign.Ptr.Diff.Diff a b) instance GHC.Read.Read (Foreign.Ptr.Diff.Diff a b) instance GHC.Show.Show (Foreign.Ptr.Diff.Diff a b) instance GHC.Classes.Ord (Foreign.Ptr.Diff.Diff a b) instance GHC.Classes.Eq (Foreign.Ptr.Diff.Diff a b) instance Foreign.Ptr.Diff.DiffTorsor GHC.Ptr.Ptr instance Foreign.Ptr.Diff.DiffTorsor GHC.Ptr.FunPtr instance Foreign.Ptr.Diff.DiffTorsor GHC.ForeignPtr.ForeignPtr instance Control.Category.Category Foreign.Ptr.Diff.Diff