repa-array-4.2.3.1: 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.

Minimal complete definition

present

Methods

present :: a -> Present Source #

Instances

Presentable Char Source # 

Methods

present :: Char -> Present Source #

Presentable Double Source # 
Presentable Float Source # 
Presentable Int Source # 

Methods

present :: Int -> Present Source #

Presentable Word8 Source # 
Presentable Word16 Source # 
Presentable Word32 Source # 
Presentable Word64 Source # 
Presentable () Source # 

Methods

present :: () -> Present Source #

Presentable Date32 Source # 
Presentable Tok Source # 

Methods

present :: Tok -> Present Source #

Presentable Str Source # 

Methods

present :: Str -> Present Source #

Presentable a => Presentable [a] Source # 

Methods

present :: [a] -> Present Source #

(Presentable a, Presentable b) => Presentable (a, b) Source # 

Methods

present :: (a, b) -> Present Source #

(Presentable a, Presentable b) => Presentable ((:*:) a b) Source # 

Methods

present :: (a :*: b) -> Present Source #

(Presentable a, Presentable b, Presentable c) => Presentable (a, b, c) Source # 

Methods

present :: (a, b, c) -> Present Source #

(Presentable a, Presentable b, Presentable c, Presentable d) => Presentable (a, b, c, d) Source # 

Methods

present :: (a, b, c, d) -> Present Source #

(Presentable a, Presentable b, Presentable c, Presentable d, Presentable e) => Presentable (a, b, c, d, e) Source # 

Methods

present :: (a, b, c, d, e) -> Present Source #

data Present Source #

A value, wrapped up nicely.

Constructors

Blank

Nothing to present.

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 (.. , ..)

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