inflist-0.0.1: An infinite list type and operations thereon.

Safe HaskellSafe

Data.InfList.InfString

Synopsis

Documentation

type InfString = InfList CharSource

Analogous to the String data type.

toStringSource

Arguments

:: InfString

An InfString to convert

-> String

the equivalent String

Convert an InfString to the equivalent infinite String.

showInfStringSource

Arguments

:: InfString

The InfString to convert

-> String

its String representation

Declaring InfString an instance of Show results in overlapping typeclasses. We instead use a simple function that converts an InfString to an infinite String.

linesSource

Arguments

:: InfString

The string to split

-> InfList String

The string split into lines

Split an InfString into an infinite list of lines.

unlinesSource

Arguments

:: InfList String

A list of lines

-> InfString

The joined string

Join an infinite list of lines into an infinite string.

wordsSource

Arguments

:: InfString

A string to split into words

-> InfList String

A list of words from the string

Split an infinite string by whitespace.

unwordsSource

Arguments

:: InfList String

A list of words

-> InfString

The words joined by spaces

Join an infinite list of words into an infinite string. A space is inserted between each word.