unicode-tricks-0.1.0.0: Functions to work with unicode blocks more convenient.

Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Data.Char.Block

Contents

Description

Unicode has 2-by-2 blocks, this module aims to make it more convenient to render such blocks.

Synopsis

Datastructures to store the state of the frame.

data Row a Source #

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.

Constructors

Row 

Fields

  • left :: a

    The left part of a row of the block.

  • right :: a

    The right part of the row of the block.

Instances
Functor Row Source # 
Instance details

Defined in Data.Char.Block

Methods

fmap :: (a -> b) -> Row a -> Row b #

(<$) :: a -> Row b -> Row a #

Applicative Row Source # 
Instance details

Defined in Data.Char.Block

Methods

pure :: a -> Row a #

(<*>) :: Row (a -> b) -> Row a -> Row b #

liftA2 :: (a -> b -> c) -> Row a -> Row b -> Row c #

(*>) :: Row a -> Row b -> Row b #

(<*) :: Row a -> Row b -> Row a #

Foldable Row Source # 
Instance details

Defined in Data.Char.Block

Methods

fold :: Monoid m => Row m -> m #

foldMap :: Monoid m => (a -> m) -> Row a -> m #

foldr :: (a -> b -> b) -> b -> Row a -> b #

foldr' :: (a -> b -> b) -> b -> Row a -> b #

foldl :: (b -> a -> b) -> b -> Row a -> b #

foldl' :: (b -> a -> b) -> b -> Row a -> b #

foldr1 :: (a -> a -> a) -> Row a -> a #

foldl1 :: (a -> a -> a) -> Row a -> a #

toList :: Row a -> [a] #

null :: Row a -> Bool #

length :: Row a -> Int #

elem :: Eq a => a -> Row a -> Bool #

maximum :: Ord a => Row a -> a #

minimum :: Ord a => Row a -> a #

sum :: Num a => Row a -> a #

product :: Num a => Row a -> a #

Traversable Row Source # 
Instance details

Defined in Data.Char.Block

Methods

traverse :: Applicative f => (a -> f b) -> Row a -> f (Row b) #

sequenceA :: Applicative f => Row (f a) -> f (Row a) #

mapM :: Monad m => (a -> m b) -> Row a -> m (Row b) #

sequence :: Monad m => Row (m a) -> m (Row a) #

Eq a => Eq (Row a) Source # 
Instance details

Defined in Data.Char.Block

Methods

(==) :: Row a -> Row a -> Bool #

(/=) :: Row a -> Row a -> Bool #

Ord a => Ord (Row a) Source # 
Instance details

Defined in Data.Char.Block

Methods

compare :: Row a -> Row a -> Ordering #

(<) :: Row a -> Row a -> Bool #

(<=) :: Row a -> Row a -> Bool #

(>) :: Row a -> Row a -> Bool #

(>=) :: Row a -> Row a -> Bool #

max :: Row a -> Row a -> Row a #

min :: Row a -> Row a -> Row a #

Read a => Read (Row a) Source # 
Instance details

Defined in Data.Char.Block

Show a => Show (Row a) Source # 
Instance details

Defined in Data.Char.Block

Methods

showsPrec :: Int -> Row a -> ShowS #

show :: Row a -> String #

showList :: [Row a] -> ShowS #

Arbitrary a => Arbitrary (Row a) Source # 
Instance details

Defined in Data.Char.Block

Methods

arbitrary :: Gen (Row a) #

shrink :: Row a -> [Row a] #

data Block a Source #

A data type that determines the state of the four subparts of the block.

Constructors

Block 

Fields

  • upper :: Row a

    The upper part of the block.

  • lower :: Row a

    The lower part of the block.

Instances
Functor Block Source # 
Instance details

Defined in Data.Char.Block

Methods

fmap :: (a -> b) -> Block a -> Block b #

(<$) :: a -> Block b -> Block a #

Applicative Block Source # 
Instance details

Defined in Data.Char.Block

Methods

pure :: a -> Block a #

(<*>) :: Block (a -> b) -> Block a -> Block b #

liftA2 :: (a -> b -> c) -> Block a -> Block b -> Block c #

(*>) :: Block a -> Block b -> Block b #

(<*) :: Block a -> Block b -> Block a #

Foldable Block Source # 
Instance details

Defined in Data.Char.Block

Methods

fold :: Monoid m => Block m -> m #

foldMap :: Monoid m => (a -> m) -> Block a -> m #

foldr :: (a -> b -> b) -> b -> Block a -> b #

foldr' :: (a -> b -> b) -> b -> Block a -> b #

foldl :: (b -> a -> b) -> b -> Block a -> b #

foldl' :: (b -> a -> b) -> b -> Block a -> b #

foldr1 :: (a -> a -> a) -> Block a -> a #

foldl1 :: (a -> a -> a) -> Block a -> a #

toList :: Block a -> [a] #

null :: Block a -> Bool #

length :: Block a -> Int #

elem :: Eq a => a -> Block a -> Bool #

maximum :: Ord a => Block a -> a #

minimum :: Ord a => Block a -> a #

sum :: Num a => Block a -> a #

product :: Num a => Block a -> a #

Traversable Block Source # 
Instance details

Defined in Data.Char.Block

Methods

traverse :: Applicative f => (a -> f b) -> Block a -> f (Block b) #

sequenceA :: Applicative f => Block (f a) -> f (Block a) #

mapM :: Monad m => (a -> m b) -> Block a -> m (Block b) #

sequence :: Monad m => Block (m a) -> m (Block a) #

Eq a => Eq (Block a) Source # 
Instance details

Defined in Data.Char.Block

Methods

(==) :: Block a -> Block a -> Bool #

(/=) :: Block a -> Block a -> Bool #

Ord a => Ord (Block a) Source # 
Instance details

Defined in Data.Char.Block

Methods

compare :: Block a -> Block a -> Ordering #

(<) :: Block a -> Block a -> Bool #

(<=) :: Block a -> Block a -> Bool #

(>) :: Block a -> Block a -> Bool #

(>=) :: Block a -> Block a -> Bool #

max :: Block a -> Block a -> Block a #

min :: Block a -> Block a -> Block a #

Read a => Read (Block a) Source # 
Instance details

Defined in Data.Char.Block

Show a => Show (Block a) Source # 
Instance details

Defined in Data.Char.Block

Methods

showsPrec :: Int -> Block a -> ShowS #

show :: Block a -> String #

showList :: [Block a] -> ShowS #

Arbitrary a => Arbitrary (Block a) Source # 
Instance details

Defined in Data.Char.Block

Methods

arbitrary :: Gen (Block a) #

shrink :: Block a -> [Block a] #

A unicode character that is (partially) filled block.

filled :: Block Bool -> Char Source #

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.