-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Functions to work with unicode blocks more convenient.
--
-- A package that makes rendering of frames, blocks, subscript and
-- superscript more convenient.
@package unicode-tricks
@version 0.3.0.0
-- | Unicode has 2-by-2 blocks, this module aims to make it more convenient
-- to render such blocks.
module Data.Char.Block
-- | A data type that determines the state of the row in a block. it
-- determines the left and the right part of the row of the block.
data Row a
Row :: a -> a -> Row a
-- | The left part of a row of the block.
[left] :: Row a -> a
-- | The right part of the row of the block.
[right] :: Row a -> a
-- | A data type that determines the state of the four subparts of the
-- block.
data Block a
Block :: Row a -> Row a -> Block a
-- | The upper part of the block.
[upper] :: Block a -> Row a
-- | The lower part of the block.
[lower] :: Block a -> Row a
-- | Convert the given Block value to a block character in unicode.
-- True means that part is filled, and False means the part
-- is not filled.
filled :: Block Bool -> Char
instance Data.Traversable.Traversable Data.Char.Block.Block
instance GHC.Show.Show a => GHC.Show.Show (Data.Char.Block.Block a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Char.Block.Block a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Char.Block.Block a)
instance GHC.Base.Functor Data.Char.Block.Block
instance Data.Foldable.Foldable Data.Char.Block.Block
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Char.Block.Block a)
instance Data.Traversable.Traversable Data.Char.Block.Row
instance GHC.Show.Show a => GHC.Show.Show (Data.Char.Block.Row a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Char.Block.Row a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Char.Block.Row a)
instance GHC.Base.Functor Data.Char.Block.Row
instance Data.Foldable.Foldable Data.Char.Block.Row
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Char.Block.Row a)
instance GHC.Base.Applicative Data.Char.Block.Block
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Data.Char.Block.Block a)
instance GHC.Base.Applicative Data.Char.Block.Row
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Data.Char.Block.Row a)
-- | Unicode has a Braille segment for Braille with six dot cells, and a
-- segment for Braille with eight dot cells, this module aims to make it
-- more convenient to render such characters.
module Data.Char.Braille
-- | A datastructure to render Braille patterns with six dots cells.
data Braille6 a
Braille6 :: Row a -> Row a -> Row a -> Braille6 a
-- | The state of the top row of the Braille character.
[top] :: Braille6 a -> Row a
-- | The state of the middle row of the Braille character.
[middle] :: Braille6 a -> Row a
-- | The state of the bottom row of the Braille character.
[bottom] :: Braille6 a -> Row a
-- | A datastructure to render Braille patterns with eight dots cells.
data Braille a
Braille :: Row a -> Row a -> Row a -> Row a -> Braille a
-- | The state of the top row of the Braille character.
[row1] :: Braille a -> Row a
-- | The state of the second row of the Braille character.
[row2] :: Braille a -> Row a
-- | The state of the third row of the Braille character.
[row3] :: Braille a -> Row a
-- | The state of the bottom row of the Braille character.
[row4] :: Braille a -> Row a
-- | Convert a Braille6 value to a Braille character, by
-- putting in a given value at the two values at the bottom row.
toBraille' :: a -> Braille6 a -> Braille a
-- | Convert a Braille6 value to a Braille6 character by
-- setting the bottom row with two False values.
toBraille :: Braille6 Bool -> Braille Bool
-- | Convert the given Braille6 value to a unicode character
-- representing this Braille value.
braille6 :: Braille6 Bool -> Char
-- | Convert the given Braille value to a unicode character
-- representing this braille value.
braille :: Braille Bool -> Char
instance Data.Traversable.Traversable Data.Char.Braille.Braille
instance GHC.Show.Show a => GHC.Show.Show (Data.Char.Braille.Braille a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Char.Braille.Braille a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Char.Braille.Braille a)
instance GHC.Base.Functor Data.Char.Braille.Braille
instance Data.Foldable.Foldable Data.Char.Braille.Braille
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Char.Braille.Braille a)
instance Data.Traversable.Traversable Data.Char.Braille.Braille6
instance GHC.Show.Show a => GHC.Show.Show (Data.Char.Braille.Braille6 a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Char.Braille.Braille6 a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Char.Braille.Braille6 a)
instance GHC.Base.Functor Data.Char.Braille.Braille6
instance Data.Foldable.Foldable Data.Char.Braille.Braille6
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Char.Braille.Braille6 a)
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Data.Char.Braille.Braille a)
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Data.Char.Braille.Braille6 a)
-- | One can make use of a block 2600 and block 1fa00 of
-- Unicode characters to render chess characters. One can render chess
-- characters as netral, white, or black pieces, for
-- such pieces one can render these rotated by 0, 90, 180 and 270
-- degrees. Knights can be rendered on 45, 135, 225 and 315 degrees as
-- well. Furthermore unicode allows to render an equihopper, and
-- special variants like a knight-queen, knight-rook, and
-- knight-bishop.
--
-- The module contains pattern synonyms for names that are often given to
-- the pieces.
module Data.Char.Chess
-- | The color of a chess piece, this can for most pieces be Black,
-- White, or Neutral.
data ChessColor
-- | White color.
White :: ChessColor
-- | Black color.
Black :: ChessColor
-- | Neutral chess pieces, sometimes depicted half white and half
-- black.
Neutral :: ChessColor
-- | A data type that defined binary colors (BWhite, and
-- BBlack), this is used for special chess pieces like a knight
-- queen, knight rook, and knight bishop that only have
-- no neutral color in unicode.
data ChessColorBinary
-- | White color.
BWhite :: ChessColorBinary
-- | Black color.
BBlack :: ChessColorBinary
-- | The type of chess pieces. Unicode includes an Equihopper as
-- piece as well.
data ChessPieceType
-- | The knight chess piece.
King :: ChessPieceType
-- | The knight chess piece.
Queen :: ChessPieceType
-- | The knight chess piece.
Rook :: ChessPieceType
-- | The knight chess piece.
Bishop :: ChessPieceType
-- | The knight chess piece.
Knight :: ChessPieceType
-- | The knigat chess piece.
Pawn :: ChessPieceType
-- | The equihopper chess piece.
Equihopper :: ChessPieceType
-- | Hybrid chess pieces like the knight-queen, knight-rook
-- and knight-bishop.
data ChessHybridType
-- | The knight-queen chess piece.
KnightQueen :: ChessHybridType
-- | The knight-rook chess piece.
KnightRook :: ChessHybridType
-- | The knight-bishop chess piece.
KnightBishop :: ChessHybridType
-- | Chess pieces that can be represented in Unicode. These are the
-- king, queen, rook, bishop, knight,
-- pawn, and equihopper over 0, 90, 180, and 270 degrees;
-- and the knight over 45, 135, 225, and
-- 315 degrees in Black, White and Neutral. .
-- Furthermore one can draw a knight-queen, knight-rook,
-- and knight-bishop pieces can be drawn without rotation and only
-- in BBlack or BWhite.
data ChessPiece
-- | Standard pieces drawn in black, white, or neutral
-- and with rotation.
Chess90 :: ChessColor -> ChessPieceType -> Rotate90 -> ChessPiece
-- | Knights have unicode characters to render these rotated over
-- 45, 135, 225 and 315 degrees.
Chess45Knight :: ChessColor -> Rotate45 -> ChessPiece
-- | Hybrid chess pieces can only be rendered in BBlack and
-- BWhite.
ChessHybrid :: ChessHybridType -> ChessColorBinary -> ChessPiece
-- | Possible rotations of the pieces. Most pieces can be rotated 0, 90,
-- 180, and 270 degrees.
data Rotate90
-- | No rotation.
R0 :: Rotate90
-- | Rotation over 90 degrees.
R90 :: Rotate90
-- | Rotation over 180 degrees.
R180 :: Rotate90
-- | Rotation over 270 degrees.
R270 :: Rotate90
-- | Extra rotations that can be performed for knight chess pieces.
data Rotate45
-- | Rotation over 45 degrees.
R45 :: Rotate45
-- | Rotation over 135 degrees.
R135 :: Rotate45
-- | Rotation over 225 degrees.
R225 :: Rotate45
-- | Rotation over 315 degrees.
R315 :: Rotate45
-- | Convert the given ChessPiece to the corresponding unicode
-- character.
chessPiece :: ChessPiece -> Char
-- | A grasshopper is a queen rotated over 180 degrees.
pattern Grasshopper :: ChessColor -> ChessPiece
-- | A Nightrider is a knight rotated over 180 degrees.
pattern Nightrider :: ChessColor -> ChessPiece
-- | An amazon is alterative name for a knight-queen.
pattern Amazon :: ChessColorBinary -> ChessPiece
-- | A terror is alterative name for a knight-queen.
pattern Terror :: ChessColorBinary -> ChessPiece
-- | An omnipotent queen is alterative name for a
-- knight-queen.
pattern OmnipotentQueen :: ChessColorBinary -> ChessPiece
-- | A superqueen is alterative name for a knight-queen.
pattern Superqueen :: ChessColorBinary -> ChessPiece
-- | A chancellor is alterative name for a knight-rook.
pattern Chancellor :: ChessColorBinary -> ChessPiece
-- | A marshall is alterative name for a knight-rook.
pattern Marshall :: ChessColorBinary -> ChessPiece
-- | An empress is alterative name for a knight-rook.
pattern Empress :: ChessColorBinary -> ChessPiece
-- | A cardinal is alterative name for a knight-bishop.
pattern Cardinal :: ChessColorBinary -> ChessPiece
-- | A princess is alterative name for a knight-bishop.
pattern Princess :: ChessColorBinary -> ChessPiece
instance GHC.Show.Show Data.Char.Chess.ChessPiece
instance GHC.Read.Read Data.Char.Chess.ChessPiece
instance GHC.Classes.Ord Data.Char.Chess.ChessPiece
instance GHC.Classes.Eq Data.Char.Chess.ChessPiece
instance GHC.Show.Show Data.Char.Chess.ChessHybridType
instance GHC.Read.Read Data.Char.Chess.ChessHybridType
instance GHC.Classes.Ord Data.Char.Chess.ChessHybridType
instance GHC.Classes.Eq Data.Char.Chess.ChessHybridType
instance GHC.Enum.Enum Data.Char.Chess.ChessHybridType
instance GHC.Enum.Bounded Data.Char.Chess.ChessHybridType
instance GHC.Show.Show Data.Char.Chess.Rotate45
instance GHC.Read.Read Data.Char.Chess.Rotate45
instance GHC.Classes.Ord Data.Char.Chess.Rotate45
instance GHC.Classes.Eq Data.Char.Chess.Rotate45
instance GHC.Enum.Enum Data.Char.Chess.Rotate45
instance GHC.Enum.Bounded Data.Char.Chess.Rotate45
instance GHC.Show.Show Data.Char.Chess.Rotate90
instance GHC.Read.Read Data.Char.Chess.Rotate90
instance GHC.Classes.Ord Data.Char.Chess.Rotate90
instance GHC.Classes.Eq Data.Char.Chess.Rotate90
instance GHC.Enum.Enum Data.Char.Chess.Rotate90
instance GHC.Enum.Bounded Data.Char.Chess.Rotate90
instance GHC.Show.Show Data.Char.Chess.ChessPieceType
instance GHC.Read.Read Data.Char.Chess.ChessPieceType
instance GHC.Classes.Ord Data.Char.Chess.ChessPieceType
instance GHC.Classes.Eq Data.Char.Chess.ChessPieceType
instance GHC.Enum.Enum Data.Char.Chess.ChessPieceType
instance GHC.Enum.Bounded Data.Char.Chess.ChessPieceType
instance GHC.Show.Show Data.Char.Chess.ChessColor
instance GHC.Read.Read Data.Char.Chess.ChessColor
instance GHC.Classes.Ord Data.Char.Chess.ChessColor
instance GHC.Classes.Eq Data.Char.Chess.ChessColor
instance GHC.Enum.Enum Data.Char.Chess.ChessColor
instance GHC.Enum.Bounded Data.Char.Chess.ChessColor
instance GHC.Show.Show Data.Char.Chess.ChessColorBinary
instance GHC.Read.Read Data.Char.Chess.ChessColorBinary
instance GHC.Classes.Ord Data.Char.Chess.ChessColorBinary
instance GHC.Classes.Eq Data.Char.Chess.ChessColorBinary
instance GHC.Enum.Enum Data.Char.Chess.ChessColorBinary
instance GHC.Enum.Bounded Data.Char.Chess.ChessColorBinary
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Chess.ChessPiece
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Chess.ChessHybridType
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Chess.Rotate45
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Chess.Rotate90
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Chess.ChessPieceType
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Chess.ChessColor
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Chess.ChessColorBinary
-- | A frame is represented as a pair of horizontal and vertical lines.
-- These can be any items, but currently only booleans and weight objects
-- are covered to convert the item to a corresponding character.
module Data.Char.Frame
-- | The weights of the frame lines, these can be Empty,
-- Light or Heavy.
data Weight
-- | The frame does not contain such line.
Empty :: Weight
-- | The frame contains such line.
Light :: Weight
-- | The frame contains such line, in boldface.
Heavy :: Weight
-- | A data type that determines the state of the horizontal lines
-- of the frame (left and right).
data Horizontal a
Horizontal :: a -> a -> Horizontal a
-- | The state of the left line of the frame.
[left] :: Horizontal a -> a
-- | The state of the right line of the frame.
[right] :: Horizontal a -> a
-- | A data type that determines the state of the vertical lines of
-- the frame (up and down).
data Vertical a
Vertical :: a -> a -> Vertical a
-- | The state of the line in the up direction of the frame.
[up] :: Vertical a -> a
-- | The state of the line in the down direction of the frame.
[down] :: Vertical a -> a
-- | A data type that specifies the four lines that should (not) be drawn
-- for the frame.
data Parts a
Parts :: Vertical a -> Horizontal a -> Parts a
-- | A type synonym that makes it more convenient to work with a
-- Parts object that wraps Bools. Usually True means
-- it should draw a line, and False that there is no line in that
-- direction.
type Simple = Parts Bool
-- | A type synonym that makes it more convenient to work with a
-- Parts object that wraps Weight objects. These specify
-- the weight .
type Weighted = Parts Weight
-- | A pattern that makes pattern matching and expressions with
-- Parts more convenient.
pattern Frame :: a -> a -> a -> a -> Parts a
-- | Convert a Simple frame to a corresponding Char. Here
-- True is mapped to a Light line.
simple :: Simple -> Char
-- | Convert a Simple frame to a corresponding Char. Here
-- True is mapped to a Heavy line.
simple' :: Simple -> Char
-- | Generate a Char where turns are done with an arc instead
-- of a corner. This can only be done for Light lines.
simpleWithArc :: Simple -> Char
-- | Converts a given Weighted to the char that can be used to
-- render frames.
weighted :: Weighted -> Char
-- | Convert a Simple frame to a Weighted frame by converting
-- True to the given Weight value.
simpleToWeighted :: Weight -> Simple -> Weighted
-- | Convert a Simple frame to a Weighted frame by converting
-- True to Light.
simpleToLight :: Simple -> Weighted
-- | Convert a Simple frame to a Weighted frame by converting
-- True to Heavy.
simpleToHeavy :: Simple -> Weighted
instance GHC.Show.Show Data.Char.Frame.Weight
instance GHC.Read.Read Data.Char.Frame.Weight
instance GHC.Classes.Ord Data.Char.Frame.Weight
instance GHC.Classes.Eq Data.Char.Frame.Weight
instance GHC.Enum.Enum Data.Char.Frame.Weight
instance GHC.Enum.Bounded Data.Char.Frame.Weight
instance Data.Traversable.Traversable Data.Char.Frame.Parts
instance GHC.Show.Show a => GHC.Show.Show (Data.Char.Frame.Parts a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Char.Frame.Parts a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Char.Frame.Parts a)
instance GHC.Base.Functor Data.Char.Frame.Parts
instance Data.Foldable.Foldable Data.Char.Frame.Parts
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Char.Frame.Parts a)
instance Data.Traversable.Traversable Data.Char.Frame.Vertical
instance GHC.Show.Show a => GHC.Show.Show (Data.Char.Frame.Vertical a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Char.Frame.Vertical a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Char.Frame.Vertical a)
instance GHC.Base.Functor Data.Char.Frame.Vertical
instance Data.Foldable.Foldable Data.Char.Frame.Vertical
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Char.Frame.Vertical a)
instance Data.Traversable.Traversable Data.Char.Frame.Horizontal
instance GHC.Show.Show a => GHC.Show.Show (Data.Char.Frame.Horizontal a)
instance GHC.Read.Read a => GHC.Read.Read (Data.Char.Frame.Horizontal a)
instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Char.Frame.Horizontal a)
instance GHC.Base.Functor Data.Char.Frame.Horizontal
instance Data.Foldable.Foldable Data.Char.Frame.Horizontal
instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Char.Frame.Horizontal a)
instance Test.QuickCheck.Arbitrary.Arbitrary Data.Char.Frame.Weight
instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Data.Char.Frame.Parts a)
instance GHC.Base.Monoid a => GHC.Base.Monoid (Data.Char.Frame.Parts a)
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Data.Char.Frame.Parts a)
instance GHC.Base.Applicative Data.Char.Frame.Parts
instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Data.Char.Frame.Vertical a)
instance GHC.Base.Monoid a => GHC.Base.Monoid (Data.Char.Frame.Vertical a)
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Data.Char.Frame.Vertical a)
instance GHC.Base.Applicative Data.Char.Frame.Vertical
instance GHC.Base.Semigroup a => GHC.Base.Semigroup (Data.Char.Frame.Horizontal a)
instance GHC.Base.Monoid a => GHC.Base.Monoid (Data.Char.Frame.Horizontal a)
instance Test.QuickCheck.Arbitrary.Arbitrary a => Test.QuickCheck.Arbitrary.Arbitrary (Data.Char.Frame.Horizontal a)
instance GHC.Base.Applicative Data.Char.Frame.Horizontal
-- | One can make use of a block of Unicode characters to
-- emulate subscript and superscript. Note that the subscript and
-- superscript will be aligned with the baseline and the cap
-- line respectively, and is thus not equivalent to
-- sub.../sub and
-- sup.../sup in HTML. Furthermore only a small
-- subset of characters is supported.
--
-- This module allows one to map certain characters to their subscript
-- and superscript counterpart, and furthermore makes it more convenient
-- to transform a number (both positive and negative) to a Text
-- that specifies this number in subscript and superscript.
module Data.Char.Small
-- | Convert a set of characters to their subscript counterpart, given that
-- characters exists.
toSub :: Char -> Maybe Char
-- | Convert a set of characters to their superscript counterpart, given
-- that characters exists.
toSup :: Char -> Maybe Char
-- | Convert a number (positive or negative) to a Text that
-- specifies that number in subscript characters.
asSub :: Integral i => i -> Text
-- | Convert a number (positive or negative) to a Text that
-- specifies that number in superscript characters.
asSup :: Integral i => i -> Text
-- | Format a given Ratio object to a Text value that formats
-- the ratio with superscript and subscript.
ratioToUnicode :: Integral i => Ratio i -> Text