Maintainer | hapytexeu+gh@gmail.com |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Unicode has 2-by-2 blocks, this module aims to make it more convenient to render such blocks.
Synopsis
- data Row a = Row {}
- rowValue :: Row Bool -> Int
- toRow :: Int -> Maybe (Row Bool)
- toRow' :: Int -> Row Bool
- pattern EmptyRow :: Row Bool
- pattern FullRow :: Row Bool
- pattern LeftRow :: Row Bool
- pattern RightRow :: Row Bool
- data Block a = Block {}
- filled :: Block Bool -> Char
- fromBlock :: Char -> Maybe (Block Bool)
- fromBlock' :: Char -> Block Bool
- pattern EmptyBlock :: Char
- pattern FullBlock :: Char
- pattern LeftHalfBlock :: Char
- pattern RightHalfBlock :: Char
Datastructures to store the state of the frame.
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.
Instances
Arbitrary1 Row Source # | |
Defined in Data.Char.Block liftArbitrary :: Gen a -> Gen (Row a) # liftShrink :: (a -> [a]) -> Row a -> [Row a] # | |
Foldable Row Source # | |
Defined in Data.Char.Block fold :: Monoid m => Row m -> m # foldMap :: Monoid m => (a -> m) -> Row a -> 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 # elem :: Eq a => a -> Row a -> Bool # maximum :: Ord a => Row a -> a # | |
Eq1 Row Source # | |
Ord1 Row Source # | |
Defined in Data.Char.Block | |
Traversable Row Source # | |
Applicative Row Source # | |
Functor Row Source # | |
NFData1 Row Source # | |
Defined in Data.Char.Block | |
Hashable1 Row Source # | |
Defined in Data.Char.Block | |
Generic1 Row Source # | |
Arbitrary a => Arbitrary (Row a) Source # | |
Data a => Data (Row a) Source # | |
Defined in Data.Char.Block gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Row a -> c (Row a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Row a) # dataTypeOf :: Row a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Row a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Row a)) # gmapT :: (forall b. Data b => b -> b) -> Row a -> Row a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Row a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Row a -> r # gmapQ :: (forall d. Data d => d -> u) -> Row a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Row a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Row a -> m (Row a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Row a -> m (Row a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Row a -> m (Row a) # | |
Bounded a => Bounded (Row a) Source # | |
Generic (Row a) Source # | |
Read a => Read (Row a) Source # | |
Show a => Show (Row a) Source # | |
NFData a => NFData (Row a) Source # | |
Defined in Data.Char.Block | |
Eq a => Eq (Row a) Source # | |
Ord a => Ord (Row a) Source # | |
Hashable a => Hashable (Row a) Source # | |
Defined in Data.Char.Block | |
MirrorVertical (Row a) Source # | |
Defined in Data.Char.Block mirrorVertical :: Row a -> Row a Source # | |
type Rep1 Row Source # | |
Defined in Data.Char.Block type Rep1 Row = D1 ('MetaData "Row" "Data.Char.Block" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) (C1 ('MetaCons "Row" 'PrefixI 'True) (S1 ('MetaSel ('Just "left") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel ('Just "right") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) | |
type Rep (Row a) Source # | |
Defined in Data.Char.Block type Rep (Row a) = D1 ('MetaData "Row" "Data.Char.Block" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) (C1 ('MetaCons "Row" 'PrefixI 'True) (S1 ('MetaSel ('Just "left") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Just "right") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) |
A data type that determines the state of the four subparts of the block.
Instances
Arbitrary1 Block Source # | |
Defined in Data.Char.Block liftArbitrary :: Gen a -> Gen (Block a) # liftShrink :: (a -> [a]) -> Block a -> [Block a] # | |
Foldable Block Source # | |
Defined in Data.Char.Block fold :: Monoid m => Block m -> m # foldMap :: Monoid m => (a -> m) -> Block a -> 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 # elem :: Eq a => a -> Block a -> Bool # maximum :: Ord a => Block a -> a # minimum :: Ord a => Block a -> a # | |
Eq1 Block Source # | |
Ord1 Block Source # | |
Defined in Data.Char.Block | |
Traversable Block Source # | |
Applicative Block Source # | |
Functor Block Source # | |
NFData1 Block Source # | |
Defined in Data.Char.Block | |
Hashable1 Block Source # | |
Defined in Data.Char.Block | |
Generic1 Block Source # | |
Arbitrary a => Arbitrary (Block a) Source # | |
Data a => Data (Block a) Source # | |
Defined in Data.Char.Block gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Block a -> c (Block a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Block a) # toConstr :: Block a -> Constr # dataTypeOf :: Block a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Block a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Block a)) # gmapT :: (forall b. Data b => b -> b) -> Block a -> Block a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Block a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Block a -> r # gmapQ :: (forall d. Data d => d -> u) -> Block a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Block a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Block a -> m (Block a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Block a -> m (Block a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Block a -> m (Block a) # | |
Bounded a => Bounded (Block a) Source # | |
Generic (Block a) Source # | |
Read a => Read (Block a) Source # | |
Show a => Show (Block a) Source # | |
NFData a => NFData (Block a) Source # | |
Defined in Data.Char.Block | |
Eq a => Eq (Block a) Source # | |
Ord a => Ord (Block a) Source # | |
Hashable a => Hashable (Block a) Source # | |
Defined in Data.Char.Block | |
MirrorHorizontal (Block a) Source # | |
Defined in Data.Char.Block mirrorHorizontal :: Block a -> Block a Source # | |
MirrorVertical (Block a) Source # | |
Defined in Data.Char.Block mirrorVertical :: Block a -> Block a Source # | |
UnicodeCharacter (Block Bool) Source # | |
Defined in Data.Char.Block | |
UnicodeText (Block Bool) Source # | |
Defined in Data.Char.Block | |
type Rep1 Block Source # | |
Defined in Data.Char.Block type Rep1 Block = D1 ('MetaData "Block" "Data.Char.Block" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) (C1 ('MetaCons "Block" 'PrefixI 'True) (S1 ('MetaSel ('Just "upper") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Row) :*: S1 ('MetaSel ('Just "lower") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Row))) | |
type Rep (Block a) Source # | |
Defined in Data.Char.Block type Rep (Block a) = D1 ('MetaData "Block" "Data.Char.Block" "unicode-tricks-0.14.0.0-5FhLRVYZEl8B73yRmH9riY" 'False) (C1 ('MetaCons "Block" 'PrefixI 'True) (S1 ('MetaSel ('Just "upper") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Row a)) :*: S1 ('MetaSel ('Just "lower") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Row a)))) |
A unicode character that is (partially) filled block.
Convert a Char
acter to a (partially) filled block.
Pattern synonyms for blocks
pattern EmptyBlock :: Char Source #
A pattern synonym for a block Char
acter that will render an empty block, this is equivalent to a space.
pattern FullBlock :: Char Source #
A pattern synonym for the block Char
acter that will render a full block.
pattern LeftHalfBlock :: Char Source #
A pattern synonym for a block Char
acter that will render a block where the left half of the block is filled.
pattern RightHalfBlock :: Char Source #
A pattern synonym for a block Char
acter that will render a block where the right half of the block is filled.