[Haskell] Re: Trying On Learn Haskell Web Server

Bulat Ziganshin bulat.ziganshin at gmail.com
Sat Mar 11 03:44:48 EST 2006

Hello Shae,

Friday, March 10, 2006, 5:19:19 PM, you wrote:

>> - Easy mapping from Haskell data structures to underlying SQL - what would be
>> called an Object-Relational Mapper (ORM) in OO languages

SME> For this, what about SerTH[1] on top of HaskellDB?

my Streams library contains even better serialization abilities. it's
still undocumented, though. if someone need a serialization lib,
please yell me - as true lazy programmer, i better work on demand ;)

just a list of features implemented in this lib:

- class-based AltBinary interface plus emulation of NewBinary library interface
- compatibility with Hugs and GHC, with GHC-specific speed optimizations
- (de)serialization speed of 20-60 mb/sec on 1GHz CPU
- free intermixing of text and binary i/o on the same Stream
- support for byte-aligned and bit-aligned, low-endian and big-endian
    serialization using the same interface
- classical Binary class with "get" and "put_" functions defines
    default representation for each type
- get/put_ uses fixed-size encoding for Int8..Word64, but variable-length encoding
    for Int/Word/Integer (including encoding of array bounds and list lengths)
- any integral value can be saved with explicitly specified size using
    functions "putBits bh bits value" and "getBits bh bits" (their shortcuts
    putBit/putWord8...putWord64/getBit/... is also supported for all integral types)
- get/put_ uses UTF8 encoding for strings/chars
- Binary class instances (i.e. get/put_ implementation) for Bounded Enum,
    Storable and all array types
- lots of alternative representations for Strings, lists and arrays,
    including ability to use user-supported function to read/write
    each list/array element, such as "putMArrayWith (putBits 15) h arr".
    for example, "putString0With (latin1Encode.putWord8) h s" implements
    ASCIIZ string encoding
- Template Haskell used to automatically derive new Binary instances
- ability to serialize data to any Stream, including Handle, raw
    files, memory-mapped files, memory and string buffers, pipes,
    network sockets and so on
- after all, it can work in any monad. the only thing required for
    it's work is something supporting ByteStream interface, i.e.
    implementing vGetByte and vPutByte operations in some monad

... and i still not mentioned some features such as (encode :: a->String)
and decode functions. i think that i implemented in this lib
everything that anyone (except for Einar ;)) ever imagined :)

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell mailing list