-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unbox variable length structures #2417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Document the APIs
- Add INLINE
peekByteIndex off arr = do | ||
len <- Unbox.peekByteIndex off arr :: IO Int | ||
let off1 = off + Unbox.sizeOf (Proxy :: Proxy Int) | ||
let peekList buf o 0 = pure (o, reverse buf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future, for the cases when the order does not matter we can define an alternative instance that does not reverse. That can be done on a newtype wrapper over list.
No description provided.