-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Two-dimensional box pretty printing, with colors -- -- Prints boxes in two dimensions, with colors. Boxes are automatically -- padded with necessary whitespace. -- -- For more information, please see the Haddock documentation and -- -- http://www.github.com/massysett/rainbox @package rainbox @version 0.4.0.2 -- | Box primitives. -- -- This module provides all functions that have access to the internals -- of a Box. There are only six functions that make a Box: -- -- -- -- There are many crude diagrams in the Haddock documentation. A dash -- means a character with data; a period means a blank character. When -- you print your Box, the blank characters will have the -- appropriate background color. module Rainbox.Box.Primitives -- | Background colors to use when inserting necessary padding. data Background Background :: Color8 -> Color256 -> Background boxBackground8 :: Background -> Color8 boxBackground256 :: Background -> Color256 -- | Alignment. data Align a -- | Vertical alignment. data Vert -- | Horizontal alignment. data Horiz center :: Align a top :: Align Vert bottom :: Align Vert left :: Align Horiz right :: Align Horiz -- | Occupies a single row on screen. The Chunk you place in a -- Bar should not have any control characters such as newlines or -- tabs, as rainbox assumes that each character in a Bar takes up -- one screen column and that each character does not create newlines. -- Leave newline handling up to rainbox. However, rainbox will not -- check to make sure that your inputs do not contain newlines, tabs, or -- other spurious characters. Similarly, use of combining characters will -- create unexpected results, as Rainbox will see something that takes up -- (for instance) two characters and think it takes up two screen -- columns, when in reality it will take up only one screen column. So, -- if you need accented characters, use a single Unicode code point, not -- two code points. For example, for é, use U+00E9, not U+0065 and -- U+0301. newtype Bar Bar :: [Chunk] -> Bar unBar :: Bar -> [Chunk] newtype Rod Rod :: [Nibble] -> Rod unRod :: Rod -> [Nibble] barToBox :: Bar -> Box barsToBox :: Background -> Align Horiz -> [Bar] -> Box data Nibble unNibble :: Nibble -> Either Spaces Chunk data Spaces numSpaces :: Spaces -> Int spcBackground :: Spaces -> Background -- | Box payload. Has the data of the box. data BoxP -- | A Box with width but no height. The Int must be at least zero. If it -- is zero, the Box has no height and no width. NoHeight :: Int -> BoxP -- | A Box that has height of at least one. It must have at least one -- component Bar. WithHeight :: [Rod] -> BoxP -- | A Box has a width in columns and a height in rows. Its height -- and width both are always at least zero. It can have positive height -- even if its width is zero, and it can have positive width even if its -- height is zero. -- -- Each row in a Box always has the same number of characters; a -- Box with zero height has no characters but still has a certain -- width. data Box unBox :: Box -> BoxP -- | A count of rows newtype Height Height :: Int -> Height unHeight :: Height -> Int -- | How many Rod are in this Box? height :: Box -> Int -- | A count of columns newtype Width Width :: Int -> Width unWidth :: Width -> Int -- | How many columns are in this thing? A column is one character wide. -- Every Bar in a Box always has the same number of -- columns. -- -- This is for things that have a single, solitary width, not things like -- columns that might have different widths at different points. class HasWidth a width :: HasWidth a => a -> Int -- | A blank Box. Useful for aligning other Box. blank :: Background -> Height -> Width -> Box -- | A Box made of Chunk. Always one Bar tall, and has as -- many columns as there are characters in the Chunk. chunks :: [Chunk] -> Box -- | Merge several Box horizontally into one Box. That is, with alignment -- set to ATop: -- --
--   --- ------- ----
--   --- -------
--   ---
--   
-- -- becomes -- --
--   --------------
--   ----------....
--   ---...........
--   
-- -- With alignment set to ABottom, becomes -- --
--   ---...........
--   ----------....
--   --------------
--   
catH :: Background -> Align Vert -> [Box] -> Box -- | Merge several Box vertically into one Box. That is, with alignment set -- to left: -- --
--   -------
--   -------
--   
--   ---
--   ---
--   
--   ----
--   ----
--   
-- -- becomes -- --
--   -------
--   -------
--   ---....
--   ---....
--   ---....
--   ----...
--   ----...
--   
-- -- With alignment set to right, becomes -- --
--   -------
--   -------
--   ....---
--   ....---
--   ...----
--   ...----
--   
catV :: Background -> Align Horiz -> [Box] -> Box viewH :: Int -> Align Horiz -> Box -> Box -- | View a Box, possibly shrinking it. You set the size of your -- viewport and how it is oriented relative to the Box as a whole. -- The Box returned may be smaller than the argument Box, -- but it will never be bigger. -- -- Examples: -- --
--   >>> :set -XOverloadedStrings
--   
--   >>> let box = catV defaultBackground top [ "ab", "cd" ]
--   
--   >>> printBox . view (Height 1) (Width 1) left top $ box
--   a
--   
-- --
--   >>> printBox . view (Height 1) (Width 1) right bottom $ box
--   d
--   
viewV :: Int -> Align Vert -> Box -> Box -- | Split a number into two parts, so that the sum of the two parts is -- equal to the original number. split :: Int -> (Int, Int) instance Eq Background instance Show Background instance Eq Spaces instance Show Spaces instance Eq Nibble instance Show Nibble instance Eq Bar instance Show Bar instance Eq Rod instance Show Rod instance Eq BoxP instance Show BoxP instance Eq Box instance Show Box instance Eq Height instance Ord Height instance Show Height instance Eq Width instance Ord Width instance Show Width instance Eq a => Eq (Align a) instance Show a => Show (Align a) instance Eq Vert instance Show Vert instance Eq Horiz instance Show Horiz instance HasWidth Chunk instance HasWidth Box instance HasWidth Bar instance IsString Box instance HasWidth BoxP instance HasWidth Rod instance IsString Rod instance Monoid Bar instance IsString Bar instance HasWidth Nibble instance IsString Nibble instance HasWidth Spaces -- | Helpers for two-dimensional arrays. module Rainbox.Array2d -- | A Table is a two-dimensional array with two associated one-dimensional -- arrays: an array of labels for each column, and an array of labels for -- each row. data Table lCol lRow col row a -- | One label for each column lCols :: Table lCol lRow col row a -> Array col lCol -- | One label for each row lRows :: Table lCol lRow col row a -> Array row lRow -- | Two-dimensional array of cells cells :: Table lCol lRow col row a -> Array (col, row) a -- | Make a new Table. table :: (Ix col, Ix row) => (col -> [(row, a)] -> lCol) -> (row -> [(col, a)] -> lRow) -> Array (col, row) a -> Table lCol lRow col row a -- | Given a two-dimensional array and a function that generates labels, -- return an array of column labels. labelCols :: (Ix col, Ix row) => (col -> [(row, a)] -> lCol) -> Array (col, row) a -> Array col lCol -- | Given a two-dimensional array and a function that generates labels, -- return an array of row labels. labelRows :: (Ix col, Ix row) => (row -> [(col, a)] -> lRow) -> Array (col, row) a -> Array row lRow -- | Transform the cells of the table. Similar to the Functor instance, but -- the mapping function has access to the label and index of each cell in -- the Table. mapTable :: (Ix col, Ix row) => (lCol -> lRow -> col -> row -> a -> b) -> Table lCol lRow col row a -> Table lCol lRow col row b -- | Transform the column labels. mapColLabels :: (Ix col, Ix row) => (lCol -> col -> [(lRow, row, a)] -> lCol') -> Table lCol lRow col row a -> Table lCol' lRow col row a -- | Transform the row labels. mapRowLabels :: (Ix col, Ix row) => (lRow -> row -> [(lCol, col, a)] -> lRow') -> Table lCol lRow col row a -> Table lCol lRow' col row a -- | Given a two-dimensional array, return a list of columns in order. cols :: (Ix col, Ix row) => Array (col, row) a -> [[a]] -- | Given a two-dimensional array, return a list of rows in order. rows :: (Ix col, Ix row) => Array (col, row) a -> [[a]] -- | Generate a two-dimensional array from a list of rows. Each row must be -- of equal length; otherwise, the generated array will have undefined -- elements. arrayByRows :: [[a]] -> Array (Int, Int) a -- | Generate a two-dimensional array from a list of columns. Each column -- must be of equal length; otherwise, the generated array will have -- undefined elements. arrayByCols :: [[a]] -> Array (Int, Int) a instance (Eq lCol, Eq lRow, Eq a, Ix col, Ix row) => Eq (Table lCol lRow col row a) instance (Show lCol, Show lRow, Show col, Show row, Show a, Ix col, Ix row) => Show (Table lCol lRow col row a) instance (Ix col, Ix row) => Functor (Table lCol lRow col row) -- | Working with Box. -- -- A Box is a rectangular block of text. You can paste Box -- together to create new rectangles, and you can grow or reduce existing -- Box to create new Boxes. -- -- There are only six primitive functions that make a Box: -- -- -- -- The other functions use these building blocks to do other useful -- things. -- -- There are many crude diagrams in the Haddock documentation. A dash -- means a character with data; a period means a blank character. When -- you print your Box, the blank characters will have the -- appropriate background color. module Rainbox.Box -- | Background colors to use when inserting necessary padding. data Background Background :: Color8 -> Color256 -> Background boxBackground8 :: Background -> Color8 boxBackground256 :: Background -> Color256 -- | Use the default background colors of the current terminal. defaultBackground :: Background backgroundFromChunk :: Chunk -> Background backgroundToTextSpec :: Background -> TextSpec -- | Use the same color for 8 and 256-color backgrounds. same :: Color8 -> Background -- | A count of rows newtype Height Height :: Int -> Height unHeight :: Height -> Int -- | How many Rod are in this Box? height :: Box -> Int -- | A count of columns newtype Width Width :: Int -> Width unWidth :: Width -> Int -- | How many columns are in this thing? A column is one character wide. -- Every Bar in a Box always has the same number of -- columns. -- -- This is for things that have a single, solitary width, not things like -- columns that might have different widths at different points. class HasWidth a width :: HasWidth a => a -> Int -- | Alignment. data Align a -- | Vertical alignment. data Vert -- | Horizontal alignment. data Horiz center :: Align a top :: Align Vert bottom :: Align Vert left :: Align Horiz right :: Align Horiz -- | Occupies a single row on screen. The Chunk you place in a -- Bar should not have any control characters such as newlines or -- tabs, as rainbox assumes that each character in a Bar takes up -- one screen column and that each character does not create newlines. -- Leave newline handling up to rainbox. However, rainbox will not -- check to make sure that your inputs do not contain newlines, tabs, or -- other spurious characters. Similarly, use of combining characters will -- create unexpected results, as Rainbox will see something that takes up -- (for instance) two characters and think it takes up two screen -- columns, when in reality it will take up only one screen column. So, -- if you need accented characters, use a single Unicode code point, not -- two code points. For example, for é, use U+00E9, not U+0065 and -- U+0301. newtype Bar Bar :: [Chunk] -> Bar unBar :: Bar -> [Chunk] barToBox :: Bar -> Box barsToBox :: Background -> Align Horiz -> [Bar] -> Box -- | A Box has a width in columns and a height in rows. Its height -- and width both are always at least zero. It can have positive height -- even if its width is zero, and it can have positive width even if its -- height is zero. -- -- Each row in a Box always has the same number of characters; a -- Box with zero height has no characters but still has a certain -- width. data Box unBox :: Box -> BoxP -- | A blank Box. Useful for aligning other Box. blank :: Background -> Height -> Width -> Box -- | A blank horizontal box with a given width and no height. blankH :: Background -> Int -> Box -- | A blank vertical box with a given length. blankV :: Background -> Int -> Box -- | A Box made of Chunk. Always one Bar tall, and has as -- many columns as there are characters in the Chunk. chunks :: [Chunk] -> Box -- | A Box made of a single Chunk. chunk :: Chunk -> Box -- | Merge several Box horizontally into one Box. That is, with alignment -- set to ATop: -- --
--   --- ------- ----
--   --- -------
--   ---
--   
-- -- becomes -- --
--   --------------
--   ----------....
--   ---...........
--   
-- -- With alignment set to ABottom, becomes -- --
--   ---...........
--   ----------....
--   --------------
--   
catH :: Background -> Align Vert -> [Box] -> Box -- | Merge several Box vertically into one Box. That is, with alignment set -- to left: -- --
--   -------
--   -------
--   
--   ---
--   ---
--   
--   ----
--   ----
--   
-- -- becomes -- --
--   -------
--   -------
--   ---....
--   ---....
--   ---....
--   ----...
--   ----...
--   
-- -- With alignment set to right, becomes -- --
--   -------
--   -------
--   ....---
--   ....---
--   ...----
--   ...----
--   
catV :: Background -> Align Horiz -> [Box] -> Box -- | sepH sep a bs lays out bs horizontally with -- alignment a, with sep amount of space in between -- each. sepH :: Background -> Int -> Align Vert -> [Box] -> Box -- | sepV sep a bs lays out bs vertically with alignment -- a, with sep amount of space in between each. sepV :: Background -> Int -> Align Horiz -> [Box] -> Box -- | punctuateH a p bs horizontally lays out the boxes bs -- with a copy of p interspersed between each. punctuateH :: Background -> Align Vert -> Box -> [Box] -> Box -- | A vertical version of punctuateH. punctuateV :: Background -> Align Horiz -> Box -> [Box] -> Box view :: Height -> Width -> Align Vert -> Align Horiz -> Box -> Box viewH :: Int -> Align Horiz -> Box -> Box -- | View a Box, possibly shrinking it. You set the size of your -- viewport and how it is oriented relative to the Box as a whole. -- The Box returned may be smaller than the argument Box, -- but it will never be bigger. -- -- Examples: -- --
--   >>> :set -XOverloadedStrings
--   
--   >>> let box = catV defaultBackground top [ "ab", "cd" ]
--   
--   >>> printBox . view (Height 1) (Width 1) left top $ box
--   a
--   
-- --
--   >>> printBox . view (Height 1) (Width 1) right bottom $ box
--   d
--   
viewV :: Int -> Align Vert -> Box -> Box -- | Grow a box. Each dimension of the result Box is never smaller -- than the corresponding dimension of the input Box. Analogous to -- view, so you give the resulting dimensions that you want. The -- alignment is analogous to view; for instance, if you specify -- that the alignment is top and left, the extra -- padding is added to the right and bottom sides of the resulting -- Box. grow :: Background -> Height -> Width -> Align Vert -> Align Horiz -> Box -> Box -- | Grow a Box horizontally. growH :: Background -> Int -> Align Horiz -> Box -> Box -- | Grow a Box vertically. growV :: Background -> Int -> Align Vert -> Box -> Box -- | Returns a list of Box, each being exactly as wide as the widest -- Box in the input list. column :: Background -> Align Horiz -> [Box] -> [Box] -- | Resize a Box. Will grow or trim it as necessary in order to -- reach the resulting size. Returns an empty Box if either -- Height or Width is less than 1. resize :: Background -> Height -> Width -> Align Vert -> Align Horiz -> Box -> Box -- | Resize horizontally. resizeH :: Background -> Int -> Align Horiz -> Box -> Box -- | Resize vertically. resizeV :: Background -> Int -> Align Vert -> Box -> Box -- | Convert a Box to Rainbow Chunks. You can then print it -- using putChunks or the like. render :: Box -> [Chunk] -- | Prints a Box to standard output. If standard output is not a terminal, -- no colors are used. Otherwise, colors are used if your TERM -- environment variable suggests they are available. printBox :: Box -> IO () -- | Box with many functions in a Reader monad. -- -- The advantage of this module over Rainbox is that many of the -- functions have fewer arguments because they are instead carried in the -- Reader monad. This also allows you to use four infix operators -- to easily join up Box. The disadvantage is that using the -- Reader monad adds a layer of indirection. module Rainbox.Reader -- | Background colors to use when inserting necessary padding. data Background Background :: Color8 -> Color256 -> Background boxBackground8 :: Background -> Color8 boxBackground256 :: Background -> Color256 -- | Use the default background colors of the current terminal. defaultBackground :: Background -- | Use the same color for 8 and 256-color backgrounds. same :: Color8 -> Background -- | Occupies a single row on screen. The Chunk you place in a -- Bar should not have any control characters such as newlines or -- tabs, as rainbox assumes that each character in a Bar takes up -- one screen column and that each character does not create newlines. -- Leave newline handling up to rainbox. However, rainbox will not -- check to make sure that your inputs do not contain newlines, tabs, or -- other spurious characters. Similarly, use of combining characters will -- create unexpected results, as Rainbox will see something that takes up -- (for instance) two characters and think it takes up two screen -- columns, when in reality it will take up only one screen column. So, -- if you need accented characters, use a single Unicode code point, not -- two code points. For example, for é, use U+00E9, not U+0065 and -- U+0301. newtype Bar Bar :: [Chunk] -> Bar unBar :: Bar -> [Chunk] -- | A Box has a width in columns and a height in rows. Its height -- and width both are always at least zero. It can have positive height -- even if its width is zero, and it can have positive width even if its -- height is zero. -- -- Each row in a Box always has the same number of characters; a -- Box with zero height has no characters but still has a certain -- width. data Box unBox :: Box -> BoxP -- | A count of rows newtype Height Height :: Int -> Height unHeight :: Height -> Int -- | How many Rod are in this Box? height :: Box -> Int -- | A count of columns newtype Width Width :: Int -> Width unWidth :: Width -> Int -- | How many columns are in this thing? A column is one character wide. -- Every Bar in a Box always has the same number of -- columns. -- -- This is for things that have a single, solitary width, not things like -- columns that might have different widths at different points. class HasWidth a width :: HasWidth a => a -> Int -- | Alignment. data Align a -- | Vertical alignment. data Vert -- | Horizontal alignment. data Horiz center :: Align a top :: Align Vert bottom :: Align Vert left :: Align Horiz right :: Align Horiz data Specs Specs :: Background -> Align Horiz -> Align Vert -> Int -> Int -> Specs background :: Specs -> Background alignH :: Specs -> Align Horiz alignV :: Specs -> Align Vert -- | Amount of intervening space for horizontal joins spaceH :: Specs -> Int spaceV :: Specs -> Int type Env = ReaderT Specs runEnv :: Specs -> Env Identity a -> a -- | A blank Box. Useful for aligning other Box. blank :: Background -> Height -> Width -> Box blankH :: Monad m => Int -> Env m Box blankV :: Monad m => Int -> Env m Box -- | A Box made of Chunk. Always one Bar tall, and has as -- many columns as there are characters in the Chunk. chunks :: [Chunk] -> Box -- | A Box made of a single Chunk. chunk :: Chunk -> Box catH :: Monad m => [Box] -> Env m Box catV :: Monad m => [Box] -> Env m Box sepH :: Monad m => Int -> [Box] -> Env m Box sepV :: Monad m => Int -> [Box] -> Env m Box punctuateH :: Monad m => Box -> [Box] -> Env m Box punctuateV :: Monad m => Box -> [Box] -> Env m Box -- | Paste two Box together horizontally with no intervening space. -- Left fixity, precedence 5. (<->) :: Monad m => Box -> Box -> Env m Box -- | Paste two Box together horizontally. Intervening space is -- determined by spaceH. Left fixity, precedence 5. (<+>) :: Monad m => Box -> Box -> Env m Box -- | Paste two Box together vertically with no intervening space. -- Left fixity, precedence 6. (/-/) :: Monad m => Box -> Box -> Env m Box -- | Paste two Box together vertically. Intervening space is -- determined by spaceV. Left fixity, precedence 6. (/+/) :: Monad m => Box -> Box -> Env m Box view :: Monad m => Height -> Width -> Box -> Env m Box viewH :: Monad m => Int -> Box -> Env m Box viewV :: Monad m => Int -> Box -> Env m Box grow :: Monad m => Height -> Width -> Box -> Env m Box growH :: Monad m => Int -> Box -> Env m Box growV :: Monad m => Int -> Box -> Env m Box column :: Monad m => [Box] -> Env m [Box] resize :: Monad m => Height -> Width -> Box -> Env m Box resizeH :: Monad m => Int -> Box -> Env m Box resizeV :: Monad m => Int -> Box -> Env m Box -- | Convert a Box to Rainbow Chunks. You can then print it -- using putChunks or the like. render :: Box -> [Chunk] -- | Prints a Box to standard output. If standard output is not a terminal, -- no colors are used. Otherwise, colors are used if your TERM -- environment variable suggests they are available. printBox :: Box -> IO () instance Eq Specs instance Show Specs -- | Create grids of (possibly) colorful boxes. -- -- For an introduction, see Rainbox.Tutorial. That file is written -- in literate Haskell, so you will want to look at the source itself. -- HsColour does not do very well with literate Haskell, so you will want -- to view the file in your text editor or on Github: -- -- -- https://github.com/massysett/rainbox/blob/master/lib/Rainbox/Tutorial.lhs -- -- This module only helps you create simple grids of cells, rather like a -- spreadsheet that does not allow you to merge or split cells. If your -- needs are more complicated, use Rainbox.Box, which allows you -- to build Boxes of arbitrary complexity by pasting simpler -- Boxes together. (You can of course use this module together -- with Rainbox.Box to create very complex layouts.) module Rainbox -- | Background colors to use when inserting necessary padding. data Background Background :: Color8 -> Color256 -> Background boxBackground8 :: Background -> Color8 boxBackground256 :: Background -> Color256 -- | Use the default background colors of the current terminal. defaultBackground :: Background backgroundFromChunk :: Chunk -> Background -- | Use the same color for 8 and 256-color backgrounds. same :: Color8 -> Background -- | Alignment. data Align a -- | Horizontal alignment. data Horiz -- | Vertical alignment. data Vert top :: Align Vert bottom :: Align Vert left :: Align Horiz right :: Align Horiz center :: Align a -- | Occupies a single row on screen. The Chunk you place in a -- Bar should not have any control characters such as newlines or -- tabs, as rainbox assumes that each character in a Bar takes up -- one screen column and that each character does not create newlines. -- Leave newline handling up to rainbox. However, rainbox will not -- check to make sure that your inputs do not contain newlines, tabs, or -- other spurious characters. Similarly, use of combining characters will -- create unexpected results, as Rainbox will see something that takes up -- (for instance) two characters and think it takes up two screen -- columns, when in reality it will take up only one screen column. So, -- if you need accented characters, use a single Unicode code point, not -- two code points. For example, for é, use U+00E9, not U+0065 and -- U+0301. newtype Bar Bar :: [Chunk] -> Bar unBar :: Bar -> [Chunk] -- | A Cell consists of multiple screen lines; each screen line is a -- Bar. data Cell Cell :: [Bar] -> Align Horiz -> Align Vert -> Background -> Cell -- | Each Bar is one line on the screen. bars :: Cell -> [Bar] -- | How this Cell aligns compared to the other Cell in its column; use -- left, center, or right. horiz :: Cell -> Align Horiz -- | How this Cell aligns compared to other Cell in its row; use -- top, center, or bottom. vert :: Cell -> Align Vert -- | Background color for necessary padding that is added to the Cell to -- make it the correct width and height. Does not affect the -- Chunk contained in the bars; these will use the colors -- that are designated in the Chunk itself. background :: Cell -> Background -- | Creates a single Box from a list of rows of Cell. Each -- list is a row of Cell. The list of rows is from top to bottom; -- within each row, the cells are given from left to right. -- -- This function is partial. Each list of Cell must be the -- same length; otherwise, your program will crash. Since you will -- typically generate the list of rows using map or list -- comprehensions or the like, this isn't typically a problem; if it is a -- problem, then check the inputs to this function with checkGrid -- before you apply it. gridByRows :: [[Cell]] -> Box -- | Creates a single Box from a list of columns of Cell. -- Each list is a column of Cell. The list of columns is from left -- to right; within each column, the cells are given from top to bottom. -- -- This function is partial. Each list of Cell must be the -- same length; otherwise, your program will crash. Since you will -- typically generate the list of columns using map or list -- comprehensions or the like, this isn't typically a problem; if it is a -- problem, then check the inputs to this function with checkGrid -- before you apply it. gridByCols :: [[Cell]] -> Box -- | Checks the input to gridByRows or gridByCols to ensure -- that it is safe. True if the list of list of Cell is safe for -- either of these functions; False if not. checkGrid :: [[Cell]] -> Bool -- | Transforms a grid of Cell to a grid of Box by adding -- necessary padding to each Cell. In every row of the array, all -- the Box will have equal height; in every column of the array, -- all the Box will have equal width. boxCells :: (Ix col, Ix row) => Array (col, row) Cell -> Array (col, row) Box -- | Use catH and catV to fuse an array of Box into a -- single Box. For example, if the bounds of the array are -- ((0,0),(3,5)), then the array has the number of cells given -- by rangeSize ((0,0), (3,5)) (that is, 24). The upper left -- corner is (0,0) and the lower right corner is (3,5); -- the upper right and lower left corners are (3,0) and -- (0,5), respectively. glueBoxes :: (Ix col, Ix row) => Array (col, row) Box -> Box -- | Convert a Box to Rainbow Chunks. You can then print it -- using putChunks or the like. render :: Box -> [Chunk] -- | Prints a Box to standard output. If standard output is not a terminal, -- no colors are used. Otherwise, colors are used if your TERM -- environment variable suggests they are available. printBox :: Box -> IO () instance Eq Cell instance Show Cell instance IsString Cell -- | If you are viewing this module in Haddock, note that the tutorial is -- contained in the source code of the module, which is written in -- literate Haskell. It is best viewed in your text editor or through -- Github at -- -- -- https://github.com/massysett/rainbox/blob/master/lib/Rainbox/Tutorial.lhs module Rainbox.Tutorial data Record Record :: String -> String -> [String] -> String -> String -> String -> Record firstName :: Record -> String lastName :: Record -> String address :: Record -> [String] phone :: Record -> String email :: Record -> String balance :: Record -> String records :: [Record] cell :: [Chunk] -> Chunk -> Cell recordToCells :: Record -> Chunk -> [Cell] cellRows :: [[Cell]] spacedOutCells :: [[Cell]] printSampleBox :: IO () instance Show Record