-- 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.2.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) -- | 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