haskell / haskell/binary

Support alignment modifiers

Open
#50 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
120
Forks
70
PR merge metrics
No merged PRs in 30d

Description

I've found myself wanting something like (might be buggy, but you get the idea)

```
aligned :: Int -> Get a -> Get a
aligned n g = do
br <- fromIntegral <$> bytesRead
skip $ n - br `rem` n
g
```

Might it be worth adding to the library, with a `Builder`/`Put` counterpart? The `Builder` side of things would require more changes to make it work than what I wrote above, but it's not all that hard.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.