That’s not a bad design pattern. I think eds struct Lib is sortah similar to that. 

On Sat, Nov 3, 2018 at 2:56 AM Henning Thielemann <lemming@henning-thielemann.de> wrote:

On Fri, 26 Oct 2018, Henning Thielemann wrote:

> There are the Storable methods
>
> peekByteOff :: Ptr b -> Int -> IO a
> pokeByteOff :: Ptr b -> Int -> a -> IO ()
>
> They ignore the target types of their pointers. Should be Addr, then, too?

Thinking about it ... these functions are intended for access of record
fields. Then the following type signatures would have been better:

peekField :: Ptr b -> Offset b a -> IO a
pokeField :: Ptr b -> Offset b a -> a -> IO ()

newtype Offset b a = Offset Int

This way we had more type safety and no need for Addr or lying Ptr's.