toolshed-0.15.0.1: Utilities used by other packages.

Safe HaskellSafe-Inferred
LanguageHaskell98

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 -> Int Source

Accessor.

getDatum :: Code a -> a Source

Accessor.