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
- weightedToSimple :: Weighted -> Simple
- fromWeighted :: Char -> Maybe Weighted
- fromWeighted' :: Char -> Weighted
- fromLight :: Char -> Maybe Simple
- fromLight' :: Char -> Simple
- fromHeavy :: Char -> Maybe Simple
- fromHeavy' :: Char -> Simple
- fromSimple :: Char -> Maybe Simple
- fromSimple' :: Char -> Simple
Line weight
Empty | The frame does not contain such line. |
Light | The frame contains such line. |
Heavy | The frame contains such line, in boldface. |
Instances
Arbitrary Weight Source # | |
Data Weight Source # | |
Defined in Data.Char.Frame gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Weight -> c Weight # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Weight # toConstr :: Weight -> Constr # dataTypeOf :: Weight -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Weight) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Weight) # gmapT :: (forall b. Data b => b -> b) -> Weight -> Weight # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Weight -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Weight -> r # gmapQ :: (forall d. Data d => d -> u) -> Weight -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Weight -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Weight -> m Weight # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Weight -> m Weight # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Weight -> m Weight # | |
Bounded Weight Source # | |
Enum Weight Source # | |
Defined in Data.Char.Frame | |
Generic Weight Source # | |
Read Weight Source # | |
Show Weight Source # | |
NFData Weight Source # | |
Defined in Data.Char.Frame | |
Eq Weight Source # | |
Ord Weight Source # | |
Hashable Weight Source # | |
Defined in Data.Char.Frame | |
UnicodeCharacter (Parts Weight) Source # | |
Defined in Data.Char.Frame | |
UnicodeText (Parts Weight) Source # | |
Defined in Data.Char.Frame | |
type Rep Weight Source # | |
Defined in Data.Char.Frame type Rep Weight = D1 ('MetaData "Weight" "Data.Char.Frame" "unicode-tricks-0.13.0.0-3Pg66jOmfjPDftx6tsr3lO" 'False) (C1 ('MetaCons "Empty" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Light" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Heavy" 'PrefixI 'False) (U1 :: Type -> Type))) |
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
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.