toolshed-0.18.0.1: Ill-defined library.

Safe HaskellSafe
LanguageHaskell2010

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.