generic-data-1.1.0.2: Deriving instances with GHC.Generics and related utilities

Safe Haskell | Safe
Language | Haskell2010

Generic.Data.Internal.Show

Description

Generic implementation of Show

### Warning

This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time.

If something here seems useful, please report it or create a pull request to export it from an external module.

Synopsis

- gshowsPrec :: (Generic a, GShow0 (Rep a)) => Int -> a -> ShowS
- gprecShows :: (Generic a, GShow0 (Rep a)) => a -> PrecShowS
- type GShow0 = GShow (Proxy :: Type -> Type)
- gliftShowsPrec :: (Generic1 f, GShow1 (Rep1 f)) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
- gLiftPrecShows :: GShow1 f => (Int -> a -> ShowS) -> ([a] -> ShowS) -> f a -> PrecShowS
- type ShowsPrec a = (Int -> a -> ShowS, [a] -> ShowS)
- type GShow1 = GShow Identity
- class GShow (p :: Type -> Type) (f :: Type -> Type) where
  - gPrecShows :: p (ShowsPrec a) -> f a -> PrecShowS
- class GShowC (p :: Type -> Type) (c :: Meta) (f :: Type -> Type) where
  - gPrecShowsC :: p (ShowsPrec a) -> String -> Fixity -> M1 C c f a -> PrecShowS
- class GShowFields (p :: Type -> Type) (f :: Type -> Type) where
  - gPrecShowsFields :: p (ShowsPrec a) -> f a -> [PrecShowS]
- class GShowNamed (p :: Type -> Type) (f :: Type -> Type) where
  - gPrecShowsNamed :: p (ShowsPrec a) -> f a -> ShowFields
- class GShowSingle (p :: Type -> Type) (f :: Type -> Type) where
  - gPrecShowsSingle :: p (ShowsPrec a) -> f a -> PrecShowS
- surroundConName :: Fixity -> String -> String

# Documentation

gshowsPrec :: (Generic a, GShow0 (Rep a)) => Int -> a -> ShowS Source #

Generic `showsPrec`.

    instance Show MyType where
      showsPrec = gshowsPrec

gprecShows :: (Generic a, GShow0 (Rep a)) => a -> PrecShowS Source #

type GShow0 = GShow (Proxy :: Type -> Type) Source #

Generic representation of `Show` types.

gliftShowsPrec :: (Generic1 f, GShow1 (Rep1 f)) => (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS Source #

Generic `liftShowsPrec`.

gLiftPrecShows :: GShow1 f => (Int -> a -> ShowS) -> ([a] -> ShowS) -> f a -> PrecShowS Source #

type ShowsPrec a = (Int -> a -> ShowS, [a] -> ShowS) Source #

type GShow1 = GShow Identity Source #

Generic representation of `Show1` types.

class GShow (p :: Type -> Type) (f :: Type -> Type) where Source #

Methods

gPrecShows :: p (ShowsPrec a) -> f a -> PrecShowS Source #

#### Instances

Instances details

GShow p (V1 :: Type -> Type) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShows :: p (ShowsPrec a) -> V1 a -> PrecShowS Source #
(GShow p f, GShow p g) => GShow p (f :+: g) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShows :: p (ShowsPrec a) -> (f :+: g) a -> PrecShowS Source #
(Constructor c, GShowC p c f) => GShow p (M1 C c f) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShows :: p (ShowsPrec a) -> M1 C c f a -> PrecShowS Source #
GShow p f => GShow p (M1 D d f) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShows :: p (ShowsPrec a) -> M1 D d f a -> PrecShowS Source #

class GShowC (p :: Type -> Type) (c :: Meta) (f :: Type -> Type) where Source #

Methods

gPrecShowsC :: p (ShowsPrec a) -> String -> Fixity -> M1 C c f a -> PrecShowS Source #

#### Instances

Instances details

GShowFields p f => GShowC p ('MetaCons s y 'False) f Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsC :: p (ShowsPrec a) -> String -> Fixity -> M1 C ('MetaCons s y 'False) f a -> PrecShowS Source #
GShowNamed p f => GShowC p ('MetaCons s y 'True) f Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsC :: p (ShowsPrec a) -> String -> Fixity -> M1 C ('MetaCons s y 'True) f a -> PrecShowS Source #

class GShowFields (p :: Type -> Type) (f :: Type -> Type) where Source #

Methods

gPrecShowsFields :: p (ShowsPrec a) -> f a -> [PrecShowS] Source #

#### Instances

Instances details

GShowFields p (U1 :: Type -> Type) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsFields :: p (ShowsPrec a) -> U1 a -> [PrecShowS] Source #
(GShowFields p f, GShowFields p g) => GShowFields p (f :*: g) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsFields :: p (ShowsPrec a) -> (f :*: g) a -> [PrecShowS] Source #
GShowSingle p f => GShowFields p (M1 S c f) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsFields :: p (ShowsPrec a) -> M1 S c f a -> [PrecShowS] Source #

class GShowNamed (p :: Type -> Type) (f :: Type -> Type) where Source #

Methods

gPrecShowsNamed :: p (ShowsPrec a) -> f a -> ShowFields Source #

#### Instances

Instances details

GShowNamed p (U1 :: Type -> Type) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsNamed :: p (ShowsPrec a) -> U1 a -> ShowFields Source #
(GShowNamed p f, GShowNamed p g) => GShowNamed p (f :*: g) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsNamed :: p (ShowsPrec a) -> (f :*: g) a -> ShowFields Source #
(Selector c, GShowSingle p f) => GShowNamed p (M1 S c f) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsNamed :: p (ShowsPrec a) -> M1 S c f a -> ShowFields Source #

class GShowSingle (p :: Type -> Type) (f :: Type -> Type) where Source #

Methods

gPrecShowsSingle :: p (ShowsPrec a) -> f a -> PrecShowS Source #

#### Instances

Instances details

GShowSingle Identity Par1 Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsSingle :: Identity (ShowsPrec a) -> Par1 a -> PrecShowS Source #
Show1 f => GShowSingle Identity (Rec1 f) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsSingle :: Identity (ShowsPrec a) -> Rec1 f a -> PrecShowS Source #
Show a => GShowSingle p (K1 i a :: Type -> Type) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsSingle :: p (ShowsPrec a0) -> K1 i a a0 -> PrecShowS Source #
(Show1 f, GShowSingle p g) => GShowSingle p (f :.: g) Source # |
Instance details Defined in Generic.Data.Internal.Show Methods gPrecShowsSingle :: p (ShowsPrec a) -> (f :.: g) a -> PrecShowS Source #

surroundConName :: Fixity -> String -> String Source #