Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Code generate type definitions in any language based on Haskell types.
Synopsis
- matchRecordLikeDataType :: TypeDef texpr -> Maybe (Text, [Field texpr])
- isEnumWithoutData :: TypeDef texpr -> Bool
- class ToTypeDefs (xs :: [Type]) texpr where
- toTypeDefs :: [TypeDef texpr]
- class ToTypeDef a texpr where
- class IsTypeExpr texpr where
- typeRef :: QualifiedName -> texpr
- class TypeExpr a texpr where
- typeExpr :: texpr
- data TypeDef texpr = TypeDef {
- qualifiedName :: QualifiedName
- cases :: [Case texpr]
- data Case texpr = Case {}
- data CaseArgs texpr
- = CasePositionalArgs [PositionalArg texpr]
- | CaseFields [Field texpr]
- data Field texpr = Field {}
- newtype PositionalArg texpr = PositionalArg {
- fieldType :: texpr
- data QualifiedName = QualifiedName {
- moduleName :: Text
- typeName :: Text
Documentation
matchRecordLikeDataType :: TypeDef texpr -> Maybe (Text, [Field texpr]) Source #
Data types with a single constructor and labeled fields | are considered record-like.
isEnumWithoutData :: TypeDef texpr -> Bool Source #
Data types with all of their constructors having no arguments
class ToTypeDefs (xs :: [Type]) texpr where Source #
Like ToTypeDef
but for a list of types.
toTypeDefs :: [TypeDef texpr] Source #
Instances
ToTypeDefs ('[] :: [Type]) texpr Source # | |
Defined in FieldsAndCases toTypeDefs :: [TypeDef texpr] Source # | |
(ToTypeDef x texpr, ToTypeDefs xs texpr) => ToTypeDefs (x ': xs) texpr Source # | |
Defined in FieldsAndCases toTypeDefs :: [TypeDef texpr] Source # |
class IsTypeExpr texpr where Source #
A class of types which can be used as type expressions.
typeRef :: QualifiedName -> texpr Source #
Instances
IsTypeExpr Text Source # | |
Defined in FieldsAndCases typeRef :: QualifiedName -> Text Source # |
class TypeExpr a texpr where Source #
Describes how to convert a type to a type expression of a specific language.
Nothing
Haskell type definition.
TypeDef | |
|
Haskell type constructor.
Haskell type constructor arguments.
CasePositionalArgs [PositionalArg texpr] | |
CaseFields [Field texpr] |
Haskell type labeled field.
newtype PositionalArg texpr Source #
Haskell type positional field.
PositionalArg | |
|
Instances
Show texpr => Show (PositionalArg texpr) Source # | |
Defined in FieldsAndCases showsPrec :: Int -> PositionalArg texpr -> ShowS # show :: PositionalArg texpr -> String # showList :: [PositionalArg texpr] -> ShowS # | |
Eq texpr => Eq (PositionalArg texpr) Source # | |
Defined in FieldsAndCases (==) :: PositionalArg texpr -> PositionalArg texpr -> Bool # (/=) :: PositionalArg texpr -> PositionalArg texpr -> Bool # |
data QualifiedName Source #
Haskell type qualified name.
QualifiedName | |
|
Instances
Show QualifiedName Source # | |
Defined in FieldsAndCases showsPrec :: Int -> QualifiedName -> ShowS # show :: QualifiedName -> String # showList :: [QualifiedName] -> ShowS # | |
Eq QualifiedName Source # | |
Defined in FieldsAndCases (==) :: QualifiedName -> QualifiedName -> Bool # (/=) :: QualifiedName -> QualifiedName -> Bool # |