repa-array-4.0.0.2: Bulk array representations and operators.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Nice.Present

Synopsis

Documentation

class Presentable a where Source

Convert some value to a form presentable to the user.

Like show but we allow the nesting structure to be preserved so it can be displayed in tabular format.

Methods

present :: a -> Present Source

data Present Source

A value, wrapped up nicely.

Constructors

Atom Text

An atomic thing.

Many [Present]

Many of the same thing, to display with list brackets [.. , ..]

Some [Present]

Some different things, to display with tuple brackets (.. , ..)

Instances

data Str Source

Wrapper to indicate a list of characters should be printed as a string, including double quotes.

Constructors

Str [Char] 

Instances

data Tok Source

Wrapper to indicate a list of characters should be printed as a string, without double quotes.

Constructors

Tok [Char] 

Instances

depth :: Present -> Int Source

Yield the nesting depth of a Present

strip1 :: Present -> Maybe [Present] Source

Strip the top layer of nesting into a list.

strip2 :: Present -> Maybe [[Present]] Source

Strip the top two layers of nesting into lists.

flatten :: Present -> Text Source

Flatten a present into text