[Haskell-cafe] Re: [Haskell] installing streams library

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed May 31 15:33:49 EDT 2006


Hello Jacques,

Wednesday, May 31, 2006, 8:07:29 PM, you wrote:

> I am completely biased in this regard:  I have spent several years
> maintaining ~800Kloc of legacy dynamically typed [commercial] code. A
> lot of this code has a life-span of roughly 20 years [ie once written,
> it takes an average of 20 years before it gets re-written].  That 
> experience has converted me to a static-type fan, as well as a fan of 
> designs that are for the "long term"; short-term convenience is 
> something that is great for short-lived code (< 5 years is short-lived
> to me ;-) ). 

my own programming experience say the same - strict typing
significantly simplify program writing by ensuring it's correctness. and
Haskell catch many problems as early as i compile code. but in this
case we will add more complexity for standard use of functions (when
just Ptr required) without any improvements in reliability just to
catch potential problems with unusual usage. moreover, there are also
encode/encodeLE/... functions that produce String - they also don't
need any special String types

why i include encoding type in function name? just to simplify usage,
all the 'encodePtr*' functions can be expressed via one encodePtrWith,
but i don't think that many peoples want to write this himself:

encodePtr                       = encodePtrWith             put_
encodePtrLE                     = encodePtrLEWith           put_
encodePtrBitAligned             = encodePtrBitAlignedWith   put_
encodePtrBitAlignedLE           = encodePtrBitAlignedLEWith put_

encodePtrLEWith           write = encodePtrWith (\s a-> withByteAlignedLE s (`write` a))
encodePtrBitAlignedWith   write = encodePtrWith (\s a-> withBitAligned    s (`write` a))
encodePtrBitAlignedLEWith write = encodePtrWith (\s a-> withBitAlignedLE  s (`write` a))


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



More information about the Haskell-Cafe mailing list