| Maintainer | hapytexeu+gh@gmail.com |
|---|---|
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Char.Frame
Description
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
Constructors
| Empty | The frame does not contain such line. |
| Light | The frame contains such line. |
| Heavy | The frame contains such line, in boldface. |
Instances
| Bounded Weight Source # | |
| Enum Weight Source # | |
Defined in Data.Char.Frame | |
| Eq Weight Source # | |
| Data Weight Source # | |
Defined in Data.Char.Frame Methods 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 # | |
| Ord Weight Source # | |
| Read Weight Source # | |
| Show Weight Source # | |
| Generic Weight Source # | |
| Arbitrary Weight Source # | |
| Hashable Weight Source # | |
Defined in Data.Char.Frame | |
| UnicodeText (Parts Weight) Source # | |
Defined in Data.Char.Frame | |
| UnicodeCharacter (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.10.0.0-AliVHfzJIeqARoOu4Sb24D" '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 #
Constructors
| Horizontal | |
Instances
Constructors
| Vertical | |
Instances
| Functor Vertical Source # | |
| Applicative Vertical Source # | |
| Foldable Vertical Source # | |
Defined in Data.Char.Frame Methods fold :: Monoid m => Vertical m -> m # foldMap :: Monoid m => (a -> m) -> Vertical a -> m # foldMap' :: Monoid m => (a -> m) -> Vertical a -> m # foldr :: (a -> b -> b) -> b -> Vertical a -> b # foldr' :: (a -> b -> b) -> b -> Vertical a -> b # foldl :: (b -> a -> b) -> b -> Vertical a -> b # foldl' :: (b -> a -> b) -> b -> Vertical a -> b # foldr1 :: (a -> a -> a) -> Vertical a -> a # foldl1 :: (a -> a -> a) -> Vertical a -> a # elem :: Eq a => a -> Vertical a -> Bool # maximum :: Ord a => Vertical a -> a # minimum :: Ord a => Vertical a -> a # | |
| Traversable Vertical Source # | |
| Arbitrary1 Vertical Source # | |
Defined in Data.Char.Frame Methods liftArbitrary :: Gen a -> Gen (Vertical a) # liftShrink :: (a -> [a]) -> Vertical a -> [Vertical a] # | |
| Eq1 Vertical Source # | |
| Ord1 Vertical Source # | |
Defined in Data.Char.Frame | |
| Hashable1 Vertical Source # | |
Defined in Data.Char.Frame | |
| Bounded a => Bounded (Vertical a) Source # | |
| Eq a => Eq (Vertical a) Source # | |
| Data a => Data (Vertical a) Source # | |
Defined in Data.Char.Frame Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Vertical a -> c (Vertical a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Vertical a) # toConstr :: Vertical a -> Constr # dataTypeOf :: Vertical a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Vertical a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Vertical a)) # gmapT :: (forall b. Data b => b -> b) -> Vertical a -> Vertical a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Vertical a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Vertical a -> r # gmapQ :: (forall d. Data d => d -> u) -> Vertical a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Vertical a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Vertical a -> m (Vertical a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Vertical a -> m (Vertical a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Vertical a -> m (Vertical a) # | |
| Ord a => Ord (Vertical a) Source # | |
| Read a => Read (Vertical a) Source # | |
| Show a => Show (Vertical a) Source # | |
| Generic (Vertical a) Source # | |
| Semigroup a => Semigroup (Vertical a) Source # | |
| (Monoid a, Semigroup a) => Monoid (Vertical a) Source # | |
| Arbitrary a => Arbitrary (Vertical a) Source # | |
| Hashable a => Hashable (Vertical a) Source # | |
Defined in Data.Char.Frame | |
| Generic1 Vertical Source # | |
| type Rep (Vertical a) Source # | |
Defined in Data.Char.Frame type Rep (Vertical a) = D1 ('MetaData "Vertical" "Data.Char.Frame" "unicode-tricks-0.10.0.0-AliVHfzJIeqARoOu4Sb24D" 'False) (C1 ('MetaCons "Vertical" 'PrefixI 'True) (S1 ('MetaSel ('Just "up") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Just "down") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |
| type Rep1 Vertical Source # | |
Defined in Data.Char.Frame type Rep1 Vertical = D1 ('MetaData "Vertical" "Data.Char.Frame" "unicode-tricks-0.10.0.0-AliVHfzJIeqARoOu4Sb24D" 'False) (C1 ('MetaCons "Vertical" 'PrefixI 'True) (S1 ('MetaSel ('Just "up") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel ('Just "down") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) | |
A data type that specifies the four lines that should (not) be drawn for the frame.
Constructors
| Parts (Vertical a) (Horizontal a) |
Instances
| Functor Parts Source # | |
| Applicative Parts Source # | |
| Foldable Parts Source # | |
Defined in Data.Char.Frame Methods fold :: Monoid m => Parts m -> m # foldMap :: Monoid m => (a -> m) -> Parts a -> 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 | |
| Eq1 Parts Source # | |
| Ord1 Parts Source # | |
Defined in Data.Char.Frame | |
| Hashable1 Parts Source # | |
Defined in Data.Char.Frame | |
| Bounded a => Bounded (Parts a) Source # | |
| Eq a => Eq (Parts a) Source # | |
| Data a => Data (Parts a) Source # | |
Defined in Data.Char.Frame Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Parts a -> c (Parts a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Parts a) # toConstr :: Parts a -> Constr # dataTypeOf :: Parts a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Parts a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Parts a)) # gmapT :: (forall b. Data b => b -> b) -> Parts a -> Parts a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Parts a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Parts a -> r # gmapQ :: (forall d. Data d => d -> u) -> Parts a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Parts a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Parts a -> m (Parts a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Parts a -> m (Parts a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Parts a -> m (Parts a) # | |
| Ord a => Ord (Parts a) Source # | |
| Read a => Read (Parts a) Source # | |
| Show a => Show (Parts a) Source # | |
| Generic (Parts a) Source # | |
| Semigroup a => Semigroup (Parts a) Source # | |
| (Monoid a, Semigroup a) => Monoid (Parts a) Source # | |
| Arbitrary a => Arbitrary (Parts a) Source # | |
| Hashable a => Hashable (Parts a) Source # | |
Defined in Data.Char.Frame | |
| UnicodeText (Parts Bool) Source # | |
Defined in Data.Char.Frame | |
| UnicodeText (Parts Weight) Source # | |
Defined in Data.Char.Frame | |
| UnicodeCharacter (Parts Bool) Source # | |
Defined in Data.Char.Frame | |
| UnicodeCharacter (Parts Weight) Source # | |
Defined in Data.Char.Frame | |
| Generic1 Parts Source # | |
| type Rep (Parts a) Source # | |
Defined in Data.Char.Frame type Rep (Parts a) = D1 ('MetaData "Parts" "Data.Char.Frame" "unicode-tricks-0.10.0.0-AliVHfzJIeqARoOu4Sb24D" 'False) (C1 ('MetaCons "Parts" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vertical a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Horizontal a)))) | |
| type Rep1 Parts Source # | |
Defined in Data.Char.Frame type Rep1 Parts = D1 ('MetaData "Parts" "Data.Char.Frame" "unicode-tricks-0.10.0.0-AliVHfzJIeqARoOu4Sb24D" 'False) (C1 ('MetaCons "Parts" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Vertical) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 Horizontal))) | |
Type aliasses and pattern synonyms for convenient Parts
Arguments
| :: 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
Arguments
| :: Weighted | The |
| -> Char | The character that represents these lines. |
Converts a given Weighted to the char that can be used to render frames.