gridbox-0.1.0.1: A grid box model

Safe HaskellSafe
LanguageHaskell2010

GridBox.Compress

Description

Grid compression

Synopsis

Documentation

type Length = Int Source #

Length of a compressed col

type CompressedGrid = [CompressedRow] Source #

Compressed grid

type CompressedRow = (BoxRow, CompressedCols) Source #

Compressed row

type CompressedCols = [CompressedCol] Source #

Compressed cols

type CompressedCol = (BoxCol, Length) Source #

Compressed col

compressBoxes :: [Box] -> CompressedGrid Source #

Compress boxes

fromCols :: [BoxCol] -> CompressedCols Source #

Convert list of box cols to compressed cols with length = 1

mergeCols :: CompressedCols -> CompressedCols Source #

Merge cols that have neighbours. Each col a and b is merged to c. The index of c is the index of a and the length of c is the sum of length a and b.