dependent-sum- Dependent sum type

Safe HaskellSafe




class GShow t where Source

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


gshowsPrec :: Int -> t a -> ShowS Source


GShow k (GOrdering k a) 
GShow k ((:=) k a) 

gshows :: GShow t => t a -> ShowS Source

gshow :: GShow t => t a -> String Source

type GReadS t = String -> [(forall b. (forall a. t a -> b) -> b, 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)

class GRead t where Source

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.


greadsPrec :: Int -> GReadS t Source


GRead k (GOrdering k a) 
GRead k ((:=) k a) 

gread :: GRead t => String -> (forall a. t a -> b) -> b Source