Maintainer | hapytexeu+gh@gmail.com |
---|---|
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
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.
Synopsis
- data Weight
- data Horizontal a = Horizontal {}
- data Vertical a = Vertical {}
- data Parts a = Parts (Vertical a) (Horizontal a)
- type Simple = Parts Bool
- type Weighted = Parts Weight
- pattern Frame :: a -> a -> a -> a -> Parts a
- simple :: Simple -> Char
- simple' :: Simple -> Char
- simpleWithArc :: Simple -> Char
- weighted :: Weighted -> Char
- simpleToWeighted :: Weight -> Simple -> Weighted
- simpleToLight :: Simple -> Weighted
- simpleToHeavy :: Simple -> Weighted
Line weight
Empty | The frame does not contain such line. |
Light | The frame contains such line. |
Heavy | The frame contains such line, in boldface. |
Datastructures to store the four directions
data Horizontal a Source #
Instances
Instances
A data type that specifies the four lines that should (not) be drawn for the frame.
Parts (Vertical a) (Horizontal a) |
Instances
Functor Parts Source # | |
Applicative Parts Source # | |
Foldable Parts Source # | |
Defined in Data.Char.Frame fold :: Monoid m => Parts m -> m # foldMap :: Monoid m => (a -> m) -> Parts a -> m # foldr :: (a -> b -> b) -> b -> Parts a -> b # foldr' :: (a -> b -> b) -> b -> Parts a -> b # foldl :: (b -> a -> b) -> b -> Parts a -> b # foldl' :: (b -> a -> b) -> b -> Parts a -> b # foldr1 :: (a -> a -> a) -> Parts a -> a # foldl1 :: (a -> a -> a) -> Parts a -> a # elem :: Eq a => a -> Parts a -> Bool # maximum :: Ord a => Parts a -> a # minimum :: Ord a => Parts a -> a # | |
Traversable Parts Source # | |
Arbitrary1 Parts Source # | |
Defined in Data.Char.Frame liftArbitrary :: Gen a -> Gen (Parts a) # liftShrink :: (a -> [a]) -> Parts a -> [Parts a] # | |
Eq a => Eq (Parts a) Source # | |
Ord a => Ord (Parts a) Source # | |
Read a => Read (Parts a) Source # | |
Show a => Show (Parts a) Source # | |
Semigroup a => Semigroup (Parts a) Source # | |
Monoid a => Monoid (Parts a) Source # | |
Arbitrary a => Arbitrary (Parts a) Source # | |
Type aliasses and pattern synonyms for convenient Parts
:: a | The state of the line in the up direction. |
-> a | The state of the line in the down direction. |
-> a | The state of the line in the left direction. |
-> a | The state of the line in the right direction. |
-> Parts a | The |
A pattern that makes pattern matching and expressions with Parts
more convenient.
Functions to render specific frame values
:: Weighted | The |
-> Char | The character that represents these lines. |
Converts a given Weighted
to the char that can be used to render frames.