syb-with-class-0.6.1.1: Scrap Your Boilerplate With Class

Data.Generics.SYB.WithClass.Basics

Synopsis

Documentation

data Proxy a Source

class (Typeable a, Sat (ctx a)) => Data ctx a whereSource

Methods

gfoldl :: Proxy ctx -> (forall b c. Data ctx b => w (b -> c) -> b -> w c) -> (forall g. g -> w g) -> a -> w aSource

gunfold :: Proxy ctx -> (forall b r. Data ctx b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c aSource

toConstr :: Proxy ctx -> a -> ConstrSource

dataTypeOf :: Proxy ctx -> a -> DataTypeSource

dataCast1 :: Typeable1 t => Proxy ctx -> (forall b. Data ctx b => w (t b)) -> Maybe (w a)Source

Mediate types and unary type constructors

dataCast2 :: Typeable2 t => Proxy ctx -> (forall b c. (Data ctx b, Data ctx c) => w (t b c)) -> Maybe (w a)Source

Mediate types and binary type constructors

type GenericT ctx = forall a. Data ctx a => a -> aSource

gmapT :: Proxy ctx -> GenericT ctx -> GenericT ctxSource

newtype ID x Source

Constructors

ID 

Fields

unID :: x
 

type GenericM m ctx = forall a. Data ctx a => a -> m aSource

gmapM :: Monad m => Proxy ctx -> GenericM m ctx -> GenericM m ctxSource

type GenericQ ctx r = forall a. Data ctx a => a -> rSource

gmapQ :: Proxy ctx -> GenericQ ctx r -> GenericQ ctx [r]Source

gmapQr :: Data ctx a => Proxy ctx -> (r' -> r -> r) -> r -> GenericQ ctx r' -> a -> rSource

newtype Qr r a Source

Constructors

Qr 

Fields

unQr :: r -> r
 

fromConstr :: Data ctx a => Proxy ctx -> Constr -> aSource

Build a term skeleton

fromConstrB :: Data ctx a => Proxy ctx -> (forall b. Data ctx b => b) -> Constr -> aSource

Build a term and use a generic function for subterms

fromConstrM :: (Monad m, Data ctx a) => Proxy ctx -> (forall b. Data ctx b => m b) -> Constr -> m aSource

Monadic variation on "fromConstrB"

data DataType Source

Representation of datatypes. | A package of constructor representations with names of type and module. | The list of constructors could be an array, a balanced tree, or others.

Constructors

DataType 

Fields

tycon :: String
 
datarep :: DataRep
 

data Constr Source

Representation of constructors

data DataRep Source

Public representation of datatypes

data ConstrRep Source

Public representation of constructors

type ConIndex = IntSource

Unique index for datatype constructors. | Textual order is respected. Starts at 1.

data Fixity Source

Fixity of constructors

Constructors

Prefix 
Infix 

dataTypeName :: DataType -> StringSource

Gets the type constructor including the module

dataTypeRep :: DataType -> DataRepSource

Gets the public presentation of datatypes

constrType :: Constr -> DataTypeSource

Gets the datatype of a constructor

constrRep :: Constr -> ConstrRepSource

Gets the public presentation of constructors

repConstr :: DataType -> ConstrRep -> ConstrSource

Look up a constructor by its representation

mkDataType :: String -> [Constr] -> DataTypeSource

Constructs an algebraic datatype

mkConstr :: DataType -> String -> [String] -> Fixity -> ConstrSource

Constructs a constructor

dataTypeConstrs :: DataType -> [Constr]Source

Gets the constructors

constrFields :: Constr -> [String]Source

Gets the field labels of a constructor

constrFixity :: Constr -> FixitySource

Gets the fixity of a constructor

showConstr :: Constr -> StringSource

Gets the string for a constructor

readConstr :: DataType -> String -> Maybe ConstrSource

Lookup a constructor via a string

isAlgType :: DataType -> BoolSource

Test for an algebraic type

indexConstr :: DataType -> ConIndex -> ConstrSource

Gets the constructor for an index

constrIndex :: Constr -> ConIndexSource

Gets the index of a constructor

maxConstrIndex :: DataType -> ConIndexSource

Gets the maximum constructor index

mkIntType :: String -> DataTypeSource

Constructs the Int type

mkFloatType :: String -> DataTypeSource

Constructs the Float type

mkStringType :: String -> DataTypeSource

Constructs the String type

mkPrimType :: DataRep -> String -> DataTypeSource

Helper for mkIntType, mkFloatType, mkStringType

mkNorepType :: String -> DataTypeSource

Constructs a non-representation

isNorepType :: DataType -> BoolSource

Test for a non-representable type