| Copyright | (C) 2014-2017 Ryan Scott |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Ryan Scott |
| Stability | Provisional |
| Portability | GHC |
| Safe Haskell | None |
| Language | Haskell2010 |
TextShow.Generic
Description
Generic versions of TextShow and TextShow1 class functions, as an alternative to
TextShow.TH, which uses Template Haskell. Because there is no Generic2
class, TextShow2 cannot be implemented generically.
This implementation is loosely based off of the Generics.Deriving.Show module
from the generic-deriving library.
Since: 2
Synopsis
- newtype FromGeneric a = FromGeneric {
- fromGeneric :: a
- newtype FromGeneric1 (f :: k -> Type) (a :: k) = FromGeneric1 {
- fromGeneric1 :: f a
- genericShowt :: (Generic a, GTextShowT (Rep a ())) => a -> Text
- genericShowtl :: (Generic a, GTextShowTL (Rep a ())) => a -> Text
- genericShowtPrec :: (Generic a, GTextShowT (Rep a ())) => Int -> a -> Text
- genericShowtlPrec :: (Generic a, GTextShowTL (Rep a ())) => Int -> a -> Text
- genericShowtList :: (Generic a, GTextShowT (Rep a ())) => [a] -> Text
- genericShowtlList :: (Generic a, GTextShowTL (Rep a ())) => [a] -> Text
- genericShowb :: (Generic a, GTextShowB (Rep a ())) => a -> Builder
- genericShowbPrec :: (Generic a, GTextShowB (Rep a ())) => Int -> a -> Builder
- genericShowbList :: (Generic a, GTextShowB (Rep a ())) => [a] -> Builder
- genericPrintT :: (Generic a, GTextShowT (Rep a ())) => a -> IO ()
- genericPrintTL :: (Generic a, GTextShowTL (Rep a ())) => a -> IO ()
- genericHPrintT :: (Generic a, GTextShowT (Rep a ())) => Handle -> a -> IO ()
- genericHPrintTL :: (Generic a, GTextShowTL (Rep a ())) => Handle -> a -> IO ()
- genericLiftShowbPrec :: (Generic1 f, GTextShowB1 (Rep1 f)) => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> f a -> Builder
- genericShowbPrec1 :: (Generic a, Generic1 f, GTextShowB (Rep a ()), GTextShowB1 (Rep1 f)) => Int -> f a -> Builder
- class GTextShowB a where
- gShowbPrec :: Int -> a -> Builder
- class GTextShowConB a where
- gShowbPrecCon :: ConType -> Int -> a -> Builder
- class (forall a. TextShow a => GTextShowB (f a)) => GTextShowB1 (f :: Type -> Type) where
- gLiftShowbPrec :: (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> f a -> Builder
- class (forall a. TextShow a => GTextShowConB (f a)) => GTextShowConB1 (f :: Type -> Type) where
- gLiftShowbPrecCon :: (Int -> a -> Builder) -> ([a] -> Builder) -> ConType -> Int -> f a -> Builder
- class GTextShowT a where
- gShowtPrec :: Int -> a -> Text
- class GTextShowConT a where
- gShowtPrecCon :: ConType -> Int -> a -> Text
- class (forall a. TextShow a => GTextShowT (f a)) => GTextShowT1 (f :: Type -> Type) where
- gLiftShowtPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text
- class (forall a. TextShow a => GTextShowConT (f a)) => GTextShowConT1 (f :: Type -> Type) where
- gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> f a -> Text
- class GTextShowTL a where
- gShowtlPrec :: Int -> a -> Text
- class GTextShowConTL a where
- gShowtlPrecCon :: ConType -> Int -> a -> Text
- class (forall a. TextShow a => GTextShowTL (f a)) => GTextShowTL1 (f :: Type -> Type) where
- gLiftShowtlPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text
- class (forall a. TextShow a => GTextShowConTL (f a)) => GTextShowConTL1 (f :: Type -> Type) where
- gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> f a -> Text
- class IsNullary (f :: k -> Type) where
- isNullary :: forall (a :: k). f a -> Bool
- data ConType
Generic adapter newtypes
newtype FromGeneric a Source #
An adapter newtype, suitable for DerivingVia.
The TextShow instance for FromGeneric leverages a Generic-based
default. That is,
showbPrecp (FromGenericx) =genericShowbPrecp x
Since: 3.7.4
Constructors
| FromGeneric | |
Fields
| |
Instances
| Functor FromGeneric Source # | |||||
Defined in TextShow.Generic Methods fmap :: (a -> b) -> FromGeneric a -> FromGeneric b # (<$) :: a -> FromGeneric b -> FromGeneric a # | |||||
| Foldable FromGeneric Source # | |||||
Defined in TextShow.Generic Methods fold :: Monoid m => FromGeneric m -> m foldMap :: Monoid m => (a -> m) -> FromGeneric a -> m foldMap' :: Monoid m => (a -> m) -> FromGeneric a -> m foldr :: (a -> b -> b) -> b -> FromGeneric a -> b foldr' :: (a -> b -> b) -> b -> FromGeneric a -> b foldl :: (b -> a -> b) -> b -> FromGeneric a -> b foldl' :: (b -> a -> b) -> b -> FromGeneric a -> b foldr1 :: (a -> a -> a) -> FromGeneric a -> a foldl1 :: (a -> a -> a) -> FromGeneric a -> a toList :: FromGeneric a -> [a] null :: FromGeneric a -> Bool length :: FromGeneric a -> Int elem :: Eq a => a -> FromGeneric a -> Bool maximum :: Ord a => FromGeneric a -> a minimum :: Ord a => FromGeneric a -> a sum :: Num a => FromGeneric a -> a product :: Num a => FromGeneric a -> a | |||||
| Traversable FromGeneric Source # | |||||
Defined in TextShow.Generic Methods traverse :: Applicative f => (a -> f b) -> FromGeneric a -> f (FromGeneric b) sequenceA :: Applicative f => FromGeneric (f a) -> f (FromGeneric a) mapM :: Monad m => (a -> m b) -> FromGeneric a -> m (FromGeneric b) # sequence :: Monad m => FromGeneric (m a) -> m (FromGeneric a) # | |||||
| Generic1 FromGeneric Source # | |||||
Defined in TextShow.Generic Associated Types
| |||||
| Lift a => Lift (FromGeneric a :: Type) Source # | |||||
Defined in TextShow.Generic Methods lift :: Quote m => FromGeneric a -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => FromGeneric a -> Code m (FromGeneric a) | |||||
| Data a => Data (FromGeneric a) Source # | |||||
Defined in TextShow.Generic Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FromGeneric a -> c (FromGeneric a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (FromGeneric a) toConstr :: FromGeneric a -> Constr dataTypeOf :: FromGeneric a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (FromGeneric a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (FromGeneric a)) gmapT :: (forall b. Data b => b -> b) -> FromGeneric a -> FromGeneric a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FromGeneric a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FromGeneric a -> r gmapQ :: (forall d. Data d => d -> u) -> FromGeneric a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> FromGeneric a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> FromGeneric a -> m (FromGeneric a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FromGeneric a -> m (FromGeneric a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FromGeneric a -> m (FromGeneric a) | |||||
| Generic (FromGeneric a) Source # | |||||
Defined in TextShow.Generic Associated Types
| |||||
| Read a => Read (FromGeneric a) Source # | |||||
Defined in TextShow.Generic Methods readsPrec :: Int -> ReadS (FromGeneric a) readList :: ReadS [FromGeneric a] readPrec :: ReadPrec (FromGeneric a) readListPrec :: ReadPrec [FromGeneric a] | |||||
| Show a => Show (FromGeneric a) Source # | |||||
Defined in TextShow.Generic Methods showsPrec :: Int -> FromGeneric a -> ShowS show :: FromGeneric a -> String showList :: [FromGeneric a] -> ShowS | |||||
| Eq a => Eq (FromGeneric a) Source # | |||||
Defined in TextShow.Generic | |||||
| Ord a => Ord (FromGeneric a) Source # | |||||
Defined in TextShow.Generic Methods compare :: FromGeneric a -> FromGeneric a -> Ordering (<) :: FromGeneric a -> FromGeneric a -> Bool (<=) :: FromGeneric a -> FromGeneric a -> Bool (>) :: FromGeneric a -> FromGeneric a -> Bool (>=) :: FromGeneric a -> FromGeneric a -> Bool max :: FromGeneric a -> FromGeneric a -> FromGeneric a min :: FromGeneric a -> FromGeneric a -> FromGeneric a | |||||
| (Generic a, GTextShowB (Rep a ())) => TextShow (FromGeneric a) Source # | Since: 3.7.4 | ||||
Defined in TextShow.Generic Methods showbPrec :: Int -> FromGeneric a -> Builder Source # showb :: FromGeneric a -> Builder Source # showbList :: [FromGeneric a] -> Builder Source # showtPrec :: Int -> FromGeneric a -> Text Source # showt :: FromGeneric a -> Text Source # showtList :: [FromGeneric a] -> Text Source # showtlPrec :: Int -> FromGeneric a -> Text Source # showtl :: FromGeneric a -> Text Source # showtlList :: [FromGeneric a] -> Text Source # | |||||
| type Rep1 FromGeneric Source # | |||||
Defined in TextShow.Generic type Rep1 FromGeneric = D1 ('MetaData "FromGeneric" "TextShow.Generic" "text-show-3.11.2-6QP1f2fw3tuAgHoJVd7xTB" 'True) (C1 ('MetaCons "FromGeneric" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromGeneric") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) | |||||
| type Rep (FromGeneric a) Source # | |||||
Defined in TextShow.Generic type Rep (FromGeneric a) = D1 ('MetaData "FromGeneric" "TextShow.Generic" "text-show-3.11.2-6QP1f2fw3tuAgHoJVd7xTB" 'True) (C1 ('MetaCons "FromGeneric" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromGeneric") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
newtype FromGeneric1 (f :: k -> Type) (a :: k) Source #
An adapter newtype, suitable for DerivingVia.
The TextShow1 instance for FromGeneric1 leverages a Generic1-based
default. That is,
liftShowbPrecsp sl p (FromGeneric1x) =genericLiftShowbPrecsp sl p x
Since: 3.7.4
Constructors
| FromGeneric1 | |
Fields
| |
Instances
| Generic1 (FromGeneric1 f :: k -> Type) Source # | |||||
Defined in TextShow.Generic Associated Types
Methods from1 :: forall (a :: k). FromGeneric1 f a -> Rep1 (FromGeneric1 f) a to1 :: forall (a :: k). Rep1 (FromGeneric1 f) a -> FromGeneric1 f a | |||||
| Lift (f a) => Lift (FromGeneric1 f a :: Type) Source # | |||||
Defined in TextShow.Generic Methods lift :: Quote m => FromGeneric1 f a -> m Exp liftTyped :: forall (m :: Type -> Type). Quote m => FromGeneric1 f a -> Code m (FromGeneric1 f a) | |||||
| Functor f => Functor (FromGeneric1 f) Source # | |||||
Defined in TextShow.Generic Methods fmap :: (a -> b) -> FromGeneric1 f a -> FromGeneric1 f b # (<$) :: a -> FromGeneric1 f b -> FromGeneric1 f a # | |||||
| Foldable f => Foldable (FromGeneric1 f) Source # | |||||
Defined in TextShow.Generic Methods fold :: Monoid m => FromGeneric1 f m -> m foldMap :: Monoid m => (a -> m) -> FromGeneric1 f a -> m foldMap' :: Monoid m => (a -> m) -> FromGeneric1 f a -> m foldr :: (a -> b -> b) -> b -> FromGeneric1 f a -> b foldr' :: (a -> b -> b) -> b -> FromGeneric1 f a -> b foldl :: (b -> a -> b) -> b -> FromGeneric1 f a -> b foldl' :: (b -> a -> b) -> b -> FromGeneric1 f a -> b foldr1 :: (a -> a -> a) -> FromGeneric1 f a -> a foldl1 :: (a -> a -> a) -> FromGeneric1 f a -> a toList :: FromGeneric1 f a -> [a] null :: FromGeneric1 f a -> Bool length :: FromGeneric1 f a -> Int elem :: Eq a => a -> FromGeneric1 f a -> Bool maximum :: Ord a => FromGeneric1 f a -> a minimum :: Ord a => FromGeneric1 f a -> a sum :: Num a => FromGeneric1 f a -> a product :: Num a => FromGeneric1 f a -> a | |||||
| Traversable f => Traversable (FromGeneric1 f) Source # | |||||
Defined in TextShow.Generic Methods traverse :: Applicative f0 => (a -> f0 b) -> FromGeneric1 f a -> f0 (FromGeneric1 f b) sequenceA :: Applicative f0 => FromGeneric1 f (f0 a) -> f0 (FromGeneric1 f a) mapM :: Monad m => (a -> m b) -> FromGeneric1 f a -> m (FromGeneric1 f b) # sequence :: Monad m => FromGeneric1 f (m a) -> m (FromGeneric1 f a) # | |||||
| (Generic1 f, GTextShowB1 (Rep1 f)) => TextShow1 (FromGeneric1 f) Source # | Since: 3.7.4 | ||||
Defined in TextShow.Generic Methods liftShowbPrec :: (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> FromGeneric1 f a -> Builder Source # liftShowbList :: (Int -> a -> Builder) -> ([a] -> Builder) -> [FromGeneric1 f a] -> Builder Source # | |||||
| (Data (f a), Typeable f, Typeable a) => Data (FromGeneric1 f a) Source # | |||||
Defined in TextShow.Generic Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FromGeneric1 f a -> c (FromGeneric1 f a) gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (FromGeneric1 f a) toConstr :: FromGeneric1 f a -> Constr dataTypeOf :: FromGeneric1 f a -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (FromGeneric1 f a)) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (FromGeneric1 f a)) gmapT :: (forall b. Data b => b -> b) -> FromGeneric1 f a -> FromGeneric1 f a gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FromGeneric1 f a -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FromGeneric1 f a -> r gmapQ :: (forall d. Data d => d -> u) -> FromGeneric1 f a -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> FromGeneric1 f a -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> FromGeneric1 f a -> m (FromGeneric1 f a) gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FromGeneric1 f a -> m (FromGeneric1 f a) gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FromGeneric1 f a -> m (FromGeneric1 f a) | |||||
| Generic (FromGeneric1 f a) Source # | |||||
Defined in TextShow.Generic Associated Types
Methods from :: FromGeneric1 f a -> Rep (FromGeneric1 f a) x to :: Rep (FromGeneric1 f a) x -> FromGeneric1 f a | |||||
| Read (f a) => Read (FromGeneric1 f a) Source # | |||||
Defined in TextShow.Generic Methods readsPrec :: Int -> ReadS (FromGeneric1 f a) readList :: ReadS [FromGeneric1 f a] readPrec :: ReadPrec (FromGeneric1 f a) readListPrec :: ReadPrec [FromGeneric1 f a] | |||||
| Show (f a) => Show (FromGeneric1 f a) Source # | |||||
Defined in TextShow.Generic Methods showsPrec :: Int -> FromGeneric1 f a -> ShowS show :: FromGeneric1 f a -> String showList :: [FromGeneric1 f a] -> ShowS | |||||
| Eq (f a) => Eq (FromGeneric1 f a) Source # | |||||
Defined in TextShow.Generic Methods (==) :: FromGeneric1 f a -> FromGeneric1 f a -> Bool (/=) :: FromGeneric1 f a -> FromGeneric1 f a -> Bool | |||||
| Ord (f a) => Ord (FromGeneric1 f a) Source # | |||||
Defined in TextShow.Generic Methods compare :: FromGeneric1 f a -> FromGeneric1 f a -> Ordering (<) :: FromGeneric1 f a -> FromGeneric1 f a -> Bool (<=) :: FromGeneric1 f a -> FromGeneric1 f a -> Bool (>) :: FromGeneric1 f a -> FromGeneric1 f a -> Bool (>=) :: FromGeneric1 f a -> FromGeneric1 f a -> Bool max :: FromGeneric1 f a -> FromGeneric1 f a -> FromGeneric1 f a min :: FromGeneric1 f a -> FromGeneric1 f a -> FromGeneric1 f a | |||||
| (Generic1 f, GTextShowB (Rep1 f a)) => TextShow (FromGeneric1 f a) Source # | Since: 3.10 | ||||
Defined in TextShow.Generic Methods showbPrec :: Int -> FromGeneric1 f a -> Builder Source # showb :: FromGeneric1 f a -> Builder Source # showbList :: [FromGeneric1 f a] -> Builder Source # showtPrec :: Int -> FromGeneric1 f a -> Text Source # showt :: FromGeneric1 f a -> Text Source # showtList :: [FromGeneric1 f a] -> Text Source # showtlPrec :: Int -> FromGeneric1 f a -> Text Source # showtl :: FromGeneric1 f a -> Text Source # showtlList :: [FromGeneric1 f a] -> Text Source # | |||||
| type Rep1 (FromGeneric1 f :: k -> Type) Source # | |||||
Defined in TextShow.Generic type Rep1 (FromGeneric1 f :: k -> Type) = D1 ('MetaData "FromGeneric1" "TextShow.Generic" "text-show-3.11.2-6QP1f2fw3tuAgHoJVd7xTB" 'True) (C1 ('MetaCons "FromGeneric1" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromGeneric1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f))) | |||||
| type Rep (FromGeneric1 f a) Source # | |||||
Defined in TextShow.Generic type Rep (FromGeneric1 f a) = D1 ('MetaData "FromGeneric1" "TextShow.Generic" "text-show-3.11.2-6QP1f2fw3tuAgHoJVd7xTB" 'True) (C1 ('MetaCons "FromGeneric1" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromGeneric1") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a)))) | |||||
Generic show functions
TextShow instances can be easily defined for data types that are Generic instances.
If you are using GHC 8.6 or later, the easiest way to do this is to use the
DerivingVia extension.
{-# LANGUAGE DeriveGeneric, DerivingVia #-}
import GHC.Generics
import TextShow
import TextShow.Generic
data D a = D a
deriving (Generic, Generic1)
deriving TextShow via FromGeneric (D a)
deriving TextShow1 via FromGeneric1 D
Or, if you are using a version of GHC older than 8.6, one can alternatively define these instances like so:
instanceTextShowa =>TextShow(D a) whereshowbPrec=genericShowbPrecinstanceTextShow1D whereliftShowbPrec=genericLiftShowbPrec
genericShowt :: (Generic a, GTextShowT (Rep a ())) => a -> Text Source #
A Generic implementation of showt.
Since: 2
genericShowtl :: (Generic a, GTextShowTL (Rep a ())) => a -> Text Source #
A Generic implementation of showtl.
Since: 2
genericShowtPrec :: (Generic a, GTextShowT (Rep a ())) => Int -> a -> Text Source #
A Generic implementation of showPrect.
Since: 2
genericShowtlPrec :: (Generic a, GTextShowTL (Rep a ())) => Int -> a -> Text Source #
A Generic implementation of showtlPrec.
Since: 2
genericShowtList :: (Generic a, GTextShowT (Rep a ())) => [a] -> Text Source #
A Generic implementation of showtList.
Since: 2
genericShowtlList :: (Generic a, GTextShowTL (Rep a ())) => [a] -> Text Source #
A Generic implementation of showtlList.
Since: 2
genericShowb :: (Generic a, GTextShowB (Rep a ())) => a -> Builder Source #
A Generic implementation of showb.
Since: 2
genericShowbPrec :: (Generic a, GTextShowB (Rep a ())) => Int -> a -> Builder Source #
A Generic implementation of showbPrec.
Since: 2
genericShowbList :: (Generic a, GTextShowB (Rep a ())) => [a] -> Builder Source #
A Generic implementation of showbList.
Since: 2
genericPrintT :: (Generic a, GTextShowT (Rep a ())) => a -> IO () Source #
A Generic implementation of printT.
Since: 2
genericPrintTL :: (Generic a, GTextShowTL (Rep a ())) => a -> IO () Source #
A Generic implementation of printTL.
Since: 2
genericHPrintT :: (Generic a, GTextShowT (Rep a ())) => Handle -> a -> IO () Source #
A Generic implementation of hPrintT.
Since: 2
genericHPrintTL :: (Generic a, GTextShowTL (Rep a ())) => Handle -> a -> IO () Source #
A Generic implementation of hPrintTL.
Since: 2
genericLiftShowbPrec :: (Generic1 f, GTextShowB1 (Rep1 f)) => (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> f a -> Builder Source #
A Generic1 implementation of genericLiftShowbPrec.
Since: 2
genericShowbPrec1 :: (Generic a, Generic1 f, GTextShowB (Rep a ()), GTextShowB1 (Rep1 f)) => Int -> f a -> Builder Source #
A Generic/Generic1 implementation of showbPrec1.
Since: 2
Internals
Builder
class GTextShowB a where Source #
Class of generic representation types that can be converted to a Builder. Since: 3.10
Methods
gShowbPrec :: Int -> a -> Builder Source #
Instances
| GTextShowB (V1 p) Source # | |
Defined in TextShow.Generic Methods gShowbPrec :: Int -> V1 p -> Builder Source # | |
| (GTextShowB (f p), GTextShowB (g p)) => GTextShowB ((f :+: g) p) Source # | |
Defined in TextShow.Generic Methods gShowbPrec :: Int -> (f :+: g) p -> Builder Source # | |
| (Constructor c, GTextShowConB (f p), IsNullary f) => GTextShowB (C1 c f p) Source # | |
Defined in TextShow.Generic Methods gShowbPrec :: Int -> C1 c f p -> Builder Source # | |
| GTextShowB (f p) => GTextShowB (D1 d f p) Source # | |
Defined in TextShow.Generic Methods gShowbPrec :: Int -> D1 d f p -> Builder Source # | |
class GTextShowConB a where Source #
Methods
gShowbPrecCon :: ConType -> Int -> a -> Builder Source #
Instances
class (forall a. TextShow a => GTextShowB (f a)) => GTextShowB1 (f :: Type -> Type) where Source #
Methods
gLiftShowbPrec :: (Int -> a -> Builder) -> ([a] -> Builder) -> Int -> f a -> Builder Source #
Instances
| GTextShowB1 (V1 :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| (GTextShowB1 f, GTextShowB1 g) => GTextShowB1 (f :+: g) Source # | |
Defined in TextShow.Generic | |
| (Constructor c, GTextShowConB1 f, IsNullary f) => GTextShowB1 (C1 c f) Source # | |
Defined in TextShow.Generic | |
| GTextShowB1 f => GTextShowB1 (D1 d f) Source # | |
Defined in TextShow.Generic | |
class (forall a. TextShow a => GTextShowConB (f a)) => GTextShowConB1 (f :: Type -> Type) where Source #
Methods
gLiftShowbPrecCon :: (Int -> a -> Builder) -> ([a] -> Builder) -> ConType -> Int -> f a -> Builder Source #
Instances
| GTextShowConB1 Par1 Source # | |
Defined in TextShow.Generic | |
| GTextShowConB1 (U1 :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| GTextShowConB1 (UChar :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| GTextShowConB1 (UDouble :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| GTextShowConB1 (UFloat :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| GTextShowConB1 (UInt :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| GTextShowConB1 (UWord :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| TextShow1 f => GTextShowConB1 (Rec1 f) Source # | |
Defined in TextShow.Generic | |
| (GTextShowConB1 f, GTextShowConB1 g) => GTextShowConB1 (f :*: g) Source # | |
Defined in TextShow.Generic | |
| TextShow c => GTextShowConB1 (K1 i c :: Type -> Type) Source # | |
Defined in TextShow.Generic | |
| (Selector s, GTextShowConB1 f) => GTextShowConB1 (S1 s f) Source # | |
Defined in TextShow.Generic | |
| (TextShow1 f, GTextShowConB1 g) => GTextShowConB1 (f :.: g) Source # | |
Defined in TextShow.Generic | |
Strict Text
class GTextShowT a where Source #
Class of generic representation types that can be converted to a Text. Since: 3.10
Methods
gShowtPrec :: Int -> a -> Text Source #
Instances
| GTextShowT (V1 p) Source # | |
Defined in TextShow.Generic Methods gShowtPrec :: Int -> V1 p -> Text Source # | |
| (GTextShowT (f p), GTextShowT (g p)) => GTextShowT ((f :+: g) p) Source # | |
Defined in TextShow.Generic Methods gShowtPrec :: Int -> (f :+: g) p -> Text Source # | |
| (Constructor c, GTextShowConT (f p), IsNullary f) => GTextShowT (C1 c f p) Source # | |
Defined in TextShow.Generic Methods gShowtPrec :: Int -> C1 c f p -> Text Source # | |
| GTextShowT (f p) => GTextShowT (D1 d f p) Source # | |
Defined in TextShow.Generic Methods gShowtPrec :: Int -> D1 d f p -> Text Source # | |
class GTextShowConT a where Source #
Methods
gShowtPrecCon :: ConType -> Int -> a -> Text Source #
Instances
| TextShow p => GTextShowConT (Par1 p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> Par1 p -> Text Source # | |
| GTextShowConT (U1 p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> U1 p -> Text Source # | |
| GTextShowConT (UChar p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> UChar p -> Text Source # | |
| GTextShowConT (UDouble p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> UDouble p -> Text Source # | |
| GTextShowConT (UFloat p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> UFloat p -> Text Source # | |
| GTextShowConT (UInt p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> UInt p -> Text Source # | |
| GTextShowConT (UWord p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> UWord p -> Text Source # | |
| (TextShow1 f, TextShow p) => GTextShowConT (Rec1 f p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> Rec1 f p -> Text Source # | |
| (GTextShowConT (f p), GTextShowConT (g p)) => GTextShowConT ((f :*: g) p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> (f :*: g) p -> Text Source # | |
| TextShow c => GTextShowConT (K1 i c p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> K1 i c p -> Text Source # | |
| (Selector s, GTextShowConT (f p)) => GTextShowConT (S1 s f p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> S1 s f p -> Text Source # | |
| (TextShow1 f, GTextShowConT (g p)) => GTextShowConT ((f :.: g) p) Source # | |
Defined in TextShow.Generic Methods gShowtPrecCon :: ConType -> Int -> (f :.: g) p -> Text Source # | |
class (forall a. TextShow a => GTextShowT (f a)) => GTextShowT1 (f :: Type -> Type) where Source #
Methods
gLiftShowtPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text Source #
Instances
| GTextShowT1 (V1 :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> V1 a -> Text Source # | |
| (GTextShowT1 f, GTextShowT1 g) => GTextShowT1 (f :+: g) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> (f :+: g) a -> Text Source # | |
| (Constructor c, GTextShowConT1 f, IsNullary f) => GTextShowT1 (C1 c f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> C1 c f a -> Text Source # | |
| GTextShowT1 f => GTextShowT1 (D1 d f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> D1 d f a -> Text Source # | |
class (forall a. TextShow a => GTextShowConT (f a)) => GTextShowConT1 (f :: Type -> Type) where Source #
Methods
gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> f a -> Text Source #
Instances
| GTextShowConT1 Par1 Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> Par1 a -> Text Source # | |
| GTextShowConT1 (U1 :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> U1 a -> Text Source # | |
| GTextShowConT1 (UChar :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UChar a -> Text Source # | |
| GTextShowConT1 (UDouble :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UDouble a -> Text Source # | |
| GTextShowConT1 (UFloat :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UFloat a -> Text Source # | |
| GTextShowConT1 (UInt :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UInt a -> Text Source # | |
| GTextShowConT1 (UWord :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UWord a -> Text Source # | |
| TextShow1 f => GTextShowConT1 (Rec1 f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> Rec1 f a -> Text Source # | |
| (GTextShowConT1 f, GTextShowConT1 g) => GTextShowConT1 (f :*: g) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> (f :*: g) a -> Text Source # | |
| TextShow c => GTextShowConT1 (K1 i c :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> K1 i c a -> Text Source # | |
| (Selector s, GTextShowConT1 f) => GTextShowConT1 (S1 s f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> S1 s f a -> Text Source # | |
| (TextShow1 f, GTextShowConT1 g) => GTextShowConT1 (f :.: g) Source # | |
Defined in TextShow.Generic Methods gLiftShowtPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> (f :.: g) a -> Text Source # | |
Lazy Text
class GTextShowTL a where Source #
Class of generic representation types that can be converted to a Text. Since: 3.10
Methods
gShowtlPrec :: Int -> a -> Text Source #
Instances
| GTextShowTL (V1 p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrec :: Int -> V1 p -> Text Source # | |
| (GTextShowTL (f p), GTextShowTL (g p)) => GTextShowTL ((f :+: g) p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrec :: Int -> (f :+: g) p -> Text Source # | |
| (Constructor c, GTextShowConTL (f p), IsNullary f) => GTextShowTL (C1 c f p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrec :: Int -> C1 c f p -> Text Source # | |
| GTextShowTL (f p) => GTextShowTL (D1 d f p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrec :: Int -> D1 d f p -> Text Source # | |
class GTextShowConTL a where Source #
Methods
gShowtlPrecCon :: ConType -> Int -> a -> Text Source #
Instances
| TextShow p => GTextShowConTL (Par1 p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> Par1 p -> Text Source # | |
| GTextShowConTL (U1 p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> U1 p -> Text Source # | |
| GTextShowConTL (UChar p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> UChar p -> Text Source # | |
| GTextShowConTL (UDouble p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> UDouble p -> Text Source # | |
| GTextShowConTL (UFloat p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> UFloat p -> Text Source # | |
| GTextShowConTL (UInt p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> UInt p -> Text Source # | |
| GTextShowConTL (UWord p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> UWord p -> Text Source # | |
| (TextShow1 f, TextShow p) => GTextShowConTL (Rec1 f p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> Rec1 f p -> Text Source # | |
| (GTextShowConTL (f p), GTextShowConTL (g p)) => GTextShowConTL ((f :*: g) p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> (f :*: g) p -> Text Source # | |
| TextShow c => GTextShowConTL (K1 i c p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> K1 i c p -> Text Source # | |
| (Selector s, GTextShowConTL (f p)) => GTextShowConTL (S1 s f p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> S1 s f p -> Text Source # | |
| (TextShow1 f, GTextShowConTL (g p)) => GTextShowConTL ((f :.: g) p) Source # | |
Defined in TextShow.Generic Methods gShowtlPrecCon :: ConType -> Int -> (f :.: g) p -> Text Source # | |
class (forall a. TextShow a => GTextShowTL (f a)) => GTextShowTL1 (f :: Type -> Type) where Source #
Methods
gLiftShowtlPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> f a -> Text Source #
Instances
| GTextShowTL1 (V1 :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> V1 a -> Text Source # | |
| (GTextShowTL1 f, GTextShowTL1 g) => GTextShowTL1 (f :+: g) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> (f :+: g) a -> Text Source # | |
| (Constructor c, GTextShowConTL1 f, IsNullary f) => GTextShowTL1 (C1 c f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> C1 c f a -> Text Source # | |
| GTextShowTL1 f => GTextShowTL1 (D1 d f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrec :: (Int -> a -> Text) -> ([a] -> Text) -> Int -> D1 d f a -> Text Source # | |
class (forall a. TextShow a => GTextShowConTL (f a)) => GTextShowConTL1 (f :: Type -> Type) where Source #
Methods
gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> f a -> Text Source #
Instances
| GTextShowConTL1 Par1 Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> Par1 a -> Text Source # | |
| GTextShowConTL1 (U1 :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> U1 a -> Text Source # | |
| GTextShowConTL1 (UChar :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UChar a -> Text Source # | |
| GTextShowConTL1 (UDouble :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UDouble a -> Text Source # | |
| GTextShowConTL1 (UFloat :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UFloat a -> Text Source # | |
| GTextShowConTL1 (UInt :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UInt a -> Text Source # | |
| GTextShowConTL1 (UWord :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> UWord a -> Text Source # | |
| TextShow1 f => GTextShowConTL1 (Rec1 f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> Rec1 f a -> Text Source # | |
| (GTextShowConTL1 f, GTextShowConTL1 g) => GTextShowConTL1 (f :*: g) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> (f :*: g) a -> Text Source # | |
| TextShow c => GTextShowConTL1 (K1 i c :: Type -> Type) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> K1 i c a -> Text Source # | |
| (Selector s, GTextShowConTL1 f) => GTextShowConTL1 (S1 s f) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> S1 s f a -> Text Source # | |
| (TextShow1 f, GTextShowConTL1 g) => GTextShowConTL1 (f :.: g) Source # | |
Defined in TextShow.Generic Methods gLiftShowtlPrecCon :: (Int -> a -> Text) -> ([a] -> Text) -> ConType -> Int -> (f :.: g) a -> Text Source # | |
Other internals
class IsNullary (f :: k -> Type) where Source #
Class of generic representation types that represent a constructor with zero or more fields.
Instances
| IsNullary Par1 Source # | |
Defined in TextShow.Generic | |
| IsNullary (U1 :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (UChar :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (UDouble :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (UFloat :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (UInt :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (UWord :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (Rec1 f :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (f :*: g :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (K1 i c :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary f => IsNullary (S1 s f :: k -> Type) Source # | |
Defined in TextShow.Generic | |
| IsNullary (f :.: g :: k -> Type) Source # | |
Defined in TextShow.Generic | |
Instances
| Data ConType Source # | |||||
Defined in TextShow.Generic Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConType -> c ConType gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ConType dataTypeOf :: ConType -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ConType) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ConType) gmapT :: (forall b. Data b => b -> b) -> ConType -> ConType gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConType -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConType -> r gmapQ :: (forall d. Data d => d -> u) -> ConType -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> ConType -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConType -> m ConType gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConType -> m ConType gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConType -> m ConType | |||||
| Generic ConType Source # | |||||
Defined in TextShow.Generic Associated Types
| |||||
| Read ConType Source # | |||||
Defined in TextShow.Generic | |||||
| Show ConType Source # | |||||
| Eq ConType Source # | |||||
| Ord ConType Source # | |||||
| TextShow ConType Source # | |||||
Defined in TextShow.Generic Methods showbPrec :: Int -> ConType -> Builder Source # showb :: ConType -> Builder Source # showbList :: [ConType] -> Builder Source # showtPrec :: Int -> ConType -> Text Source # showt :: ConType -> Text Source # showtList :: [ConType] -> Text Source # showtlPrec :: Int -> ConType -> Text Source # showtl :: ConType -> Text Source # showtlList :: [ConType] -> Text Source # | |||||
| Lift ConType Source # | |||||
| type Rep ConType Source # | |||||
Defined in TextShow.Generic type Rep ConType = D1 ('MetaData "ConType" "TextShow.Generic" "text-show-3.11.2-6QP1f2fw3tuAgHoJVd7xTB" 'False) ((C1 ('MetaCons "Rec" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Tup" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Pref" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Inf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) | |||||