toolshed-0.13.0.0: Utilities used by other packages.

Safe HaskellSafe-Infered

ToolShed.Data.List.Runlength

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
Run-length encoder and decoder.

Synopsis

Types

Type-synonyms

type Code a = (Int, a)Source

Describes the number of consecutive equal items in a list.

Functions

encode :: Eq a => [a] -> [Code a]Source

Run-length encodes the specified list.

decode :: [Code a] -> [a]Source

Performs run-length decoding to retrieve the original unencoded list.

Accessors

getLength :: Code a -> IntSource

Accessor.

getDatum :: Code a -> aSource

Accessor.