[clean-list] newbie

Ronny Wichers Schreur ronny@cs.kun.nl
Tue, 19 Dec 2000 11:44:43 +0100


Marc Poppleton writes:

>I'm a new user of Clean and I'm looking for a way to manipulate bit strings.
>The thing is, I can't find anything about it neither in the language report 
>nor in the clean book (functionnal programming in clean).

There's no library with bit vectors, so you'll have to program it yourself.

Small bit vectors you could represent with Ints, which are 32 bit. Use the
bit functions in StdInt (bitand, bitor, etc) to implement your operations.
Larger (fixed sized) bit vectors could be represented by an array of unboxed
Ints ({#Int}). With a destructive update in this array you will get constant
time for the set bit operation.


Cheers,

Ronny Wichers Schreur