| Safe Haskell | Safe |
|---|---|
| Language | Haskell98 |
Data.GADT.Show
Synopsis
- class GShow t where
- gshowsPrec :: Int -> t a -> ShowS
- gshows :: GShow t => t a -> ShowS
- gshow :: GShow t => t a -> String
- newtype GReadResult t = GReadResult {
- getGReadResult :: forall b. (forall a. t a -> b) -> b
- type GReadS t = String -> [(GReadResult t, String)]
- class GRead t where
- greadsPrec :: Int -> GReadS t
- greads :: GRead t => GReadS t
- gread :: GRead t => String -> (forall a. t a -> b) -> b
- greadMaybe :: GRead t => String -> (forall a. t a -> b) -> Maybe b
Documentation
>>>import Data.Some
Show-like class for 1-type-parameter GADTs. GShow t => ... is equivalent to something
like (forall a. Show (t a)) => .... The easiest way to create instances would probably be
to write (or derive) an instance Show (T a), and then simply say:
instance GShow t where gshowsPrec = showsPrec
Methods
gshowsPrec :: Int -> t a -> ShowS Source #
Instances
| GShow (TypeRep :: k -> Type) Source # | |
Defined in Data.GADT.Show | |
| GShow ((:~:) a :: k -> Type) Source # | |
Defined in Data.GADT.Show | |
| GShow (GOrdering a :: k -> Type) Source # | |
Defined in Data.GADT.Compare | |
| (GShow a, GShow b) => GShow (Product a b :: k -> Type) Source # |
|
Defined in Data.GADT.Show | |
| (GShow a, GShow b) => GShow (Sum a b :: k -> Type) Source # |
|
Defined in Data.GADT.Show | |
newtype GReadResult t Source #
Constructors
| GReadResult | |
Fields
| |
type GReadS t = String -> [(GReadResult t, String)] Source #
GReadS t is equivalent to ReadS (forall b. (forall a. t a -> b) -> b), which is
in turn equivalent to ReadS (Exists t) (with data Exists t where Exists :: t a -> Exists t)
Read-like class for 1-type-parameter GADTs. Unlike GShow, this one cannot be
mechanically derived from a Read instance because greadsPrec must choose the phantom
type based on the String being parsed.
Methods
greadsPrec :: Int -> GReadS t Source #