Popularity
1.3
Declining
Activity
3.2
Declining
2
2
0

Monthly Downloads: 12
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Codec    
Latest version: v0.1.0.1

hcobs alternatives and similar packages

Based on the "Codec" category.
Alternatively, view hcobs alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of hcobs or a related project?

Add another 'Codec' Package

README

hcobs

Build Status

Haskell implementation of the Consistent Overhead Byte Stuffing algorithm.

It provides a Stuffed newtype wrapper for Lazy Bytestrings, which is parametrized on the Byte (Word8, represented as a type-level Nat) to be encoded away.

The implementation tries to be as efficient as possible, type safe and easy to use. If you have a "sink" like

sink :: Stuffed 0 -> IO ()
sink = undefined

You'd then simply be able to encode a Bytestring with sink $ stuff bytes.

You can try this out in ghci with:

> :set -XOverloadedStrings
> :set -XDataKinds
> import Data.Stuffed
> let stuffedBytes = stuff "a\0b\0c" :: Stuffed 0
> unpack $ unwrap stuffedBytes -- directly access the underlying bytestring
[2,97,2,98,2,99]
> unpack $ unstuff stuffedBytes
[97,0,98,0,99]