Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.Generics.SYB.WithClass.Basics
- module Data.Typeable
- module Data.Generics.SYB.WithClass.Context
- data Proxy a
- class (Typeable a, Sat (ctx a)) => Data ctx a where
- type GenericT ctx = forall a. Data ctx a => a -> a
- gmapT :: Proxy ctx -> GenericT ctx -> GenericT ctx
- newtype ID x = ID {
- unID :: x
- type GenericM m ctx = forall a. Data ctx a => a -> m a
- gmapM :: Monad m => Proxy ctx -> GenericM m ctx -> GenericM m ctx
- type GenericQ ctx r = forall a. Data ctx a => a -> r
- gmapQ :: Proxy ctx -> GenericQ ctx r -> GenericQ ctx [r]
- gmapQr :: Data ctx a => Proxy ctx -> (r' -> r -> r) -> r -> GenericQ ctx r' -> a -> r
- newtype Qr r a = Qr {
- unQr :: r -> r
- fromConstr :: Data ctx a => Proxy ctx -> Constr -> a
- fromConstrB :: Data ctx a => Proxy ctx -> (forall b. Data ctx b => b) -> Constr -> a
- fromConstrM :: (Monad m, Data ctx a) => Proxy ctx -> (forall b. Data ctx b => m b) -> Constr -> m a
- data DataType = DataType {}
- data Constr = Constr {}
- data DataRep
- data ConstrRep
- type ConIndex = Int
- data Fixity
- dataTypeName :: DataType -> String
- dataTypeRep :: DataType -> DataRep
- constrType :: Constr -> DataType
- constrRep :: Constr -> ConstrRep
- repConstr :: DataType -> ConstrRep -> Constr
- mkDataType :: String -> [Constr] -> DataType
- mkConstr :: DataType -> String -> [String] -> Fixity -> Constr
- dataTypeConstrs :: DataType -> [Constr]
- constrFields :: Constr -> [String]
- constrFixity :: Constr -> Fixity
- showConstr :: Constr -> String
- readConstr :: DataType -> String -> Maybe Constr
- isAlgType :: DataType -> Bool
- indexConstr :: DataType -> ConIndex -> Constr
- constrIndex :: Constr -> ConIndex
- maxConstrIndex :: DataType -> ConIndex
- mkIntType :: String -> DataType
- mkFloatType :: String -> DataType
- mkStringType :: String -> DataType
- mkPrimType :: DataRep -> String -> DataType
- mkPrimCon :: DataType -> String -> ConstrRep -> Constr
- mkIntConstr :: DataType -> Integer -> Constr
- mkFloatConstr :: DataType -> Double -> Constr
- mkStringConstr :: DataType -> String -> Constr
- mkNorepType :: String -> DataType
- isNorepType :: DataType -> Bool
Documentation
module Data.Typeable
class (Typeable a, Sat (ctx a)) => Data ctx a where Source #
Minimal complete definition
Methods
gfoldl :: Proxy ctx -> (forall b c. Data ctx b => w (b -> c) -> b -> w c) -> (forall g. g -> w g) -> a -> w a Source #
gunfold :: Proxy ctx -> (forall b r. Data ctx b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c a Source #
toConstr :: Proxy ctx -> a -> Constr Source #
dataTypeOf :: Proxy ctx -> a -> DataType Source #
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
fromConstrB :: Data ctx a => Proxy ctx -> (forall b. Data ctx b => b) -> Constr -> a Source #
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 a Source #
Monadic variation on "fromConstrB"
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.
Representation of constructors
Constructors
Constr | |
Public representation of datatypes
Public representation of constructors
Constructors
AlgConstr ConIndex | |
IntConstr Integer | |
FloatConstr Double | |
StringConstr String |
Unique index for datatype constructors. | Textual order is respected. Starts at 1.
Fixity of constructors
dataTypeName :: DataType -> String Source #
Gets the type constructor including the module
dataTypeRep :: DataType -> DataRep Source #
Gets the public presentation of datatypes
constrType :: Constr -> DataType Source #
Gets the datatype of a constructor
dataTypeConstrs :: DataType -> [Constr] Source #
Gets the constructors
constrFields :: Constr -> [String] Source #
Gets the field labels of a constructor
constrFixity :: Constr -> Fixity Source #
Gets the fixity of a constructor
showConstr :: Constr -> String Source #
Gets the string for a constructor
constrIndex :: Constr -> ConIndex Source #
Gets the index of a constructor
maxConstrIndex :: DataType -> ConIndex Source #
Gets the maximum constructor index
mkFloatType :: String -> DataType Source #
Constructs the Float type
mkStringType :: String -> DataType Source #
Constructs the String type
mkNorepType :: String -> DataType Source #
Constructs a non-representation
isNorepType :: DataType -> Bool Source #
Test for a non-representable type