Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Drawing
- render :: BoxDrawingStyle -> Drawing -> Char
- lookup :: BoxDrawingStyle -> Char -> Maybe Drawing
- read :: BoxDrawingStyle -> Char -> Drawing
- overlay :: BoxDrawingStyle -> Drawing -> Char -> Char
- data BoxDrawingStyle
- ascii :: BoxDrawingStyle
- unicode :: BoxDrawingStyle
- up :: Drawing
- down :: Drawing
- left :: Drawing
- right :: Drawing
- horizontal :: Drawing
- vertical :: Drawing
- cornerTL :: Drawing
- cornerTR :: Drawing
- cornerBR :: Drawing
- cornerBL :: Drawing
- intersectFull :: Drawing
- intersectL :: Drawing
- intersectR :: Drawing
- intersectT :: Drawing
- intersectB :: Drawing
- heavy :: Drawing
- heavyHoriz :: Drawing
- heavyVert :: Drawing
- dashed2 :: Drawing
- dashed3 :: Drawing
- double :: Drawing
- doubleHoriz :: Drawing
- doubleVert :: Drawing
- rounded :: Drawing
Box border type
A box border which can be rendered to a terminal given a BoxDrawingStyle
Use the Monoid
and Semigroup
instances to combine box borders.
The internal representation is just a Word8
; the least-significant four
bits specify the base directions of the box drawing (up, down, left, or
right), and the most-significant four bits specify the style (see rounded
,
dashed2
, etc) which has its own special logic for how styles can be
combined.
overlay :: BoxDrawingStyle -> Drawing -> Char -> Char Source #
Get the character that best represents visually overlaying the given box drawing and a character.
Box drawing styles
data BoxDrawingStyle Source #
ascii :: BoxDrawingStyle Source #
A basic box-drawing style that uses |
, +
, and -
unicode :: BoxDrawingStyle Source #
An advanced box-drawing style that supports all the drawing primitives provided in this module
Drawings
Base primitives
Combinations
horizontal :: Drawing Source #
intersectL :: Drawing Source #
intersectR :: Drawing Source #
intersectT :: Drawing Source #
intersectB :: Drawing Source #
Box drawing modifiers
Combine these using the Semigroup
instance with another Drawing
to set
its style, such as heavy, dashed, etc. - only relevant for the style
unicode
and has no effect for the style ascii
.
heavyHoriz :: Drawing Source #
doubleVert :: Drawing Source #