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

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

Data.Char.Braille

Contents

Description

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.

Synopsis

Datastructures to store the state of the Braille character.

data Braille6 a Source #

A datastructure to render Braille patterns with six dots cells.

Constructors

Braille6 

Fields

  • top :: Row a

    The state of the top row of the Braille character.

  • middle :: Row a

    The state of the middle row of the Braille character.

  • bottom :: Row a

    The state of the bottom row of the Braille character.

Instances
Functor Braille6 Source # 
Instance details

Defined in Data.Char.Braille

Methods

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

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

Foldable Braille6 Source # 
Instance details

Defined in Data.Char.Braille

Methods

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

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

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

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

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

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

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

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

toList :: Braille6 a -> [a] #

null :: Braille6 a -> Bool #

length :: Braille6 a -> Int #

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

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

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

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

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

Traversable Braille6 Source # 
Instance details

Defined in Data.Char.Braille

Methods

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

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

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

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

Arbitrary1 Braille6 Source # 
Instance details

Defined in Data.Char.Braille

Methods

liftArbitrary :: Gen a -> Gen (Braille6 a) #

liftShrink :: (a -> [a]) -> Braille6 a -> [Braille6 a] #

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

Defined in Data.Char.Braille

Methods

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

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

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

Defined in Data.Char.Braille

Methods

compare :: Braille6 a -> Braille6 a -> Ordering #

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

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

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

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

max :: Braille6 a -> Braille6 a -> Braille6 a #

min :: Braille6 a -> Braille6 a -> Braille6 a #

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

Defined in Data.Char.Braille

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

Defined in Data.Char.Braille

Methods

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

show :: Braille6 a -> String #

showList :: [Braille6 a] -> ShowS #

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

Defined in Data.Char.Braille

Methods

arbitrary :: Gen (Braille6 a) #

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

data Braille a Source #

A datastructure to render Braille patterns with eight dots cells.

Constructors

Braille 

Fields

  • row1 :: Row a

    The state of the top row of the Braille character.

  • row2 :: Row a

    The state of the second row of the Braille character.

  • row3 :: Row a

    The state of the third row of the Braille character.

  • row4 :: Row a

    The state of the bottom row of the Braille character.

Instances
Functor Braille Source # 
Instance details

Defined in Data.Char.Braille

Methods

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

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

Foldable Braille Source # 
Instance details

Defined in Data.Char.Braille

Methods

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

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

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

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

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

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

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

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

toList :: Braille a -> [a] #

null :: Braille a -> Bool #

length :: Braille a -> Int #

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

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

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

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

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

Traversable Braille Source # 
Instance details

Defined in Data.Char.Braille

Methods

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

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

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

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

Arbitrary1 Braille Source # 
Instance details

Defined in Data.Char.Braille

Methods

liftArbitrary :: Gen a -> Gen (Braille a) #

liftShrink :: (a -> [a]) -> Braille a -> [Braille a] #

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

Defined in Data.Char.Braille

Methods

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

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

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

Defined in Data.Char.Braille

Methods

compare :: Braille a -> Braille a -> Ordering #

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

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

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

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

max :: Braille a -> Braille a -> Braille a #

min :: Braille a -> Braille a -> Braille a #

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

Defined in Data.Char.Braille

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

Defined in Data.Char.Braille

Methods

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

show :: Braille a -> String #

showList :: [Braille a] -> ShowS #

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

Defined in Data.Char.Braille

Methods

arbitrary :: Gen (Braille a) #

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

Converting Braille6 to Braille

toBraille' Source #

Arguments

:: a

The value to put in the cells of the bottom row.

-> Braille6 a

The given Braille6 value to convert.

-> Braille a

A Braille value that uses as bottom two values given as first parameter.

Convert a Braille6 value to a Braille character, by putting in a given value at the two values at the bottom row.

toBraille Source #

Arguments

:: Braille6 Bool

The given Braille6 value to convert.

-> Braille Bool

A Braille value that uses as bottom two times False.

Convert a Braille6 value to a Braille6 character by setting the bottom row with two False values.

Rendering Braille characters.

braille6 :: Braille6 Bool -> Char Source #

Convert the given Braille6 value to a unicode character representing this Braille value.

braille :: Braille Bool -> Char Source #

Convert the given Braille value to a unicode character representing this braille value.