dep-software-0.1.0.0
Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Dep.Bricks.Utils

Description

A module that is used to render lines, arrows, rasters, etc.

Synopsis

Convert to an Image

fromRaster Source #

Arguments

:: Attr

The Attribute that determines how to render the raster.

-> Raster

The given list of strings that we want to render.

-> Image

The corresponding image by vertically aligning the rows of the raster.

Convert a given list of strings to an Image where all the images have the same attribute.

Lines

hline Source #

Arguments

:: Text

The Text object that determines how to render the line. The items will be cycled.

-> Attr

The Attribute that determines how to render the line.

-> Int

The given length of the line.

-> Image

An Image that contains a horizontal line with the given length.

Render a horizontal line by cycling through the given Text and apply the given Attribute to the result.

hline' Source #

Arguments

:: String

The String object that determines how to render the line. The items will be cycled.

-> Attr

The Attribute that determines how to render the line.

-> Int

The given length of the line.

-> Image

An Image that contains a horizontal line with the given length.

A function equivalent to hline, but with a String to specify the Characters instead of a Text object.

vline Source #

Arguments

:: Text

The String object that determines how to render the line. The items will be cycled.

-> Attr

The Attribute that determines how to render the line.

-> Int

The given length of the line.

-> Image

An Image that contains a vertical line with the given length.

Render a vertical line by cycling through the given Text and apply the given Attribute to the result.

vline' Source #

Arguments

:: String

The String object that determines how to render the line. The items will be cycled.

-> Attr

The Attribute that determines how to render the line.

-> Int

The given length of the line.

-> Image

An Image that contains a vertical line with the given length.

A function equivalent to vline, but with a String to specify the Characters instead of a Text object.

Arrows

harrow Source #

Arguments

:: Char

The left arrow head.

-> Text

The Text in the middle that is constantly repeated.

-> Char

The right arrow head.

-> Attr

The Attribute to specify the style of the arrow.

-> Int

The number characters between the arrow heads (so we are not counting the arrow heads).

-> Image

An image that shows a horizontal arrow with a given number of characters in the middle.

Render a horizontal arrow with the given number of characters between the arrow heads. The Text in the middle is "cycled".

harrow' Source #

Arguments

:: Char

The left arrow head.

-> String

The String in the middle that is constantly repeated.

-> Char

The right arrow head.

-> Attr

The Attribute to specify the style of the arrow.

-> Int

The number characters between the arrow heads (so we are not counting the arrow heads).

-> Image

An image that shows a horizontal arrow with a given number of characters in the middle.

A function equivalent to harrow, but where we use a String to specify the Characters in the middle.

varrow Source #

Arguments

:: Char

The top arrow head.

-> Text

The Text in the middle that is constantly repeated.

-> Char

The bottom arrow head.

-> Attr

The Attribute to specify the style of the arrow.

-> Int

The number characters between the arrow heads (so we are not counting the arrow heads).

-> Image

An image that shows a vertical arrow with a given number of characters in the middle.

Render a vertical arrow with the given number of characters between the arrow heads. The Text in the middle is "cycled".

varrow' Source #

Arguments

:: Char

The top arrow head.

-> String

The String in the middle that is constantly repeated.

-> Char

The bottom arrow head.

-> Attr

The Attribute to specify the style of the arrow.

-> Int

The number characters between the arrow heads (so we are not counting the arrow heads).

-> Image

An image that shows a vertical arrow with a given number of characters in the middle.

A function equivalent to varrow, but where we use a String to specify the Characters in the middle.

Type aliasses for rows and rasters

type Row = String Source #

A Row is a simple String, typically a row in an Raster (and later an Image).

type Raster = [Row] Source #

A list of lists of Characters is a Raster, typically this is used to convert this to an Image.

Raster (for Karnaugh cards)

inRaster Source #

Arguments

:: Attr

The Attribute that specifies how to render the raster border.

-> Image

The Image that we want to wrap in a raster.

-> Image

An Image that contains the given image wrapped in a raster.

Wrap the given Image in a raster structure with thick borders and with small lines for the raster image in the middle.

inRaster' Source #

Arguments

:: Raster

The given list of Strings that we want to wrap in a raster.

-> Raster

A list of Strings that contains the given image wrapped in a raster.

Wrap the given list of Strings in a raster structure with thick borders and with small lines for the raster image in the middle.