anchor.diff:      open BitMap
       let bitmapExtension = ".sbm" // sparse binary map
       let valuesExtension = ".sbv" // sparse binary values
  +
  +    let pow2 y = 1 <<< y
  +
  +    let writeBooleans (bools:bool []) (writer:BinaryWriter) =
  +        // compress 8 booleans in one byte
  +        let compressed = 
  +            seq {
  +                let b = ref 0uy
  +                for i=0 to bools.Length-1 do
  +                    let rem = (i  % 8)
  +                    if rem = 0 && i<> 0 then 
  +                        yield !b
  +                        b := 0uy
  +                    if bools.[i] then
  +                        b := !b + (byte (pow2 rem))
  +                yield !b
  +            } |> Array.ofSeq
  +        compressed |> (fun bytes -> writer.Write(bytes))
  +
       let writeBitMap fileName (map:bitmap []) =
           use writer = new BinaryWriter(File.Open(fileName, FileMode.OpenOrCreate))
           let nrows = map.Length
           let ncols = (fst map.[0]).Length
           writer.Write(nrows)
           writer.Write(ncols)
  -
  -        let boolArray = Array.init ncols (fun i -> true)
  -        for (bitarray,_) in map do
  -            bitarray.CopyTo(boolArray, 0)
  -            boolArray |> Array.iter (fun b -> (writer.Write(b))) 
  +        for (boolArray,_) in map do
  +            writeBooleans boolArray writer
   
       let writeValues fileName (values:seq<int option>) =
           use writer = new BinaryWriter(File.Open(fileName, FileMode.OpenOrCreate))
  
positive.code:         writeValues valuesPath values
      
      let cache = new Dictionary<string, bitmap []>()
  
      let readBitMap bitMapFileName = 
          if cache.ContainsKey(bitMapFileName) then 
  
negative.code:             use reader = new BinaryReader(File.Open(bitMapFileName, FileMode.Open, FileAccess.Read, FileShare.Read))
              let nrows = reader.ReadInt32()
              let ncols = reader.ReadInt32()
              let createRowBitMap i = BitMap.ofArray (readBooleansRow ncols reader)
              let map = Array.init nrows createRowBitMap
              BitMap.transform map
              cache.Add(bitMapFileName, map)
  