Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines how the derived Haskell data types are represented. - It is useful for writing type conversion rules.
Synopsis
- data ETypeDef
- data EType
- newtype ETCon = ETCon {}
- newtype ETVar = ETVar {}
- data ETypeName = ETypeName {}
- data EPrimAlias = EPrimAlias {}
- data EAlias = EAlias {
- ea_name :: ETypeName
- ea_fields :: [(String, EType)]
- ea_omit_null :: Bool
- ea_newtype :: Bool
- ea_unwrap_unary :: Bool
- data SumTypeFields
- isNamed :: SumTypeFields -> Bool
- data SumTypeConstructor = STC {}
- data ESum = ESum {}
- unpackTupleType :: EType -> [EType]
- unpackToplevelConstr :: EType -> [EType]
- class IsElmDefinition a where
- compileElmDef :: Proxy a -> ETypeDef
- newtype SumEncoding' = SumEncoding' SumEncoding
- defSumEncoding :: SumEncoding'
- toElmType :: Typeable a => Proxy a -> EType
Documentation
Type definition, including constructors.
Type construction : type variables, type constructors, tuples and type application.
Type constructor:
ETCon "Int"
Type variable:
ETVar "a"
Type name:
ETypeName "Map" [ETVar "k", ETVar "v"]
data EPrimAlias Source #
Instances
Eq EPrimAlias Source # | |
Defined in Elm.TyRep (==) :: EPrimAlias -> EPrimAlias -> Bool # (/=) :: EPrimAlias -> EPrimAlias -> Bool # | |
Ord EPrimAlias Source # | |
Defined in Elm.TyRep compare :: EPrimAlias -> EPrimAlias -> Ordering # (<) :: EPrimAlias -> EPrimAlias -> Bool # (<=) :: EPrimAlias -> EPrimAlias -> Bool # (>) :: EPrimAlias -> EPrimAlias -> Bool # (>=) :: EPrimAlias -> EPrimAlias -> Bool # max :: EPrimAlias -> EPrimAlias -> EPrimAlias # min :: EPrimAlias -> EPrimAlias -> EPrimAlias # | |
Show EPrimAlias Source # | |
Defined in Elm.TyRep showsPrec :: Int -> EPrimAlias -> ShowS # show :: EPrimAlias -> String # showList :: [EPrimAlias] -> ShowS # | |
ElmRenderable EPrimAlias Source # | |
Defined in Elm.TyRender renderElm :: EPrimAlias -> String Source # |
EAlias | |
|
data SumTypeFields Source #
Instances
Eq SumTypeFields Source # | |
Defined in Elm.TyRep (==) :: SumTypeFields -> SumTypeFields -> Bool # (/=) :: SumTypeFields -> SumTypeFields -> Bool # | |
Ord SumTypeFields Source # | |
Defined in Elm.TyRep compare :: SumTypeFields -> SumTypeFields -> Ordering # (<) :: SumTypeFields -> SumTypeFields -> Bool # (<=) :: SumTypeFields -> SumTypeFields -> Bool # (>) :: SumTypeFields -> SumTypeFields -> Bool # (>=) :: SumTypeFields -> SumTypeFields -> Bool # max :: SumTypeFields -> SumTypeFields -> SumTypeFields # min :: SumTypeFields -> SumTypeFields -> SumTypeFields # | |
Show SumTypeFields Source # | |
Defined in Elm.TyRep showsPrec :: Int -> SumTypeFields -> ShowS # show :: SumTypeFields -> String # showList :: [SumTypeFields] -> ShowS # |
isNamed :: SumTypeFields -> Bool Source #
data SumTypeConstructor Source #
STC | |
|
Instances
Eq SumTypeConstructor Source # | |
Defined in Elm.TyRep (==) :: SumTypeConstructor -> SumTypeConstructor -> Bool # (/=) :: SumTypeConstructor -> SumTypeConstructor -> Bool # | |
Ord SumTypeConstructor Source # | |
Defined in Elm.TyRep compare :: SumTypeConstructor -> SumTypeConstructor -> Ordering # (<) :: SumTypeConstructor -> SumTypeConstructor -> Bool # (<=) :: SumTypeConstructor -> SumTypeConstructor -> Bool # (>) :: SumTypeConstructor -> SumTypeConstructor -> Bool # (>=) :: SumTypeConstructor -> SumTypeConstructor -> Bool # max :: SumTypeConstructor -> SumTypeConstructor -> SumTypeConstructor # min :: SumTypeConstructor -> SumTypeConstructor -> SumTypeConstructor # | |
Show SumTypeConstructor Source # | |
Defined in Elm.TyRep showsPrec :: Int -> SumTypeConstructor -> ShowS # show :: SumTypeConstructor -> String # showList :: [SumTypeConstructor] -> ShowS # |
ESum | |
|
unpackTupleType :: EType -> [EType] Source #
Transforms tuple types in a list of types. Otherwise returns a singleton list with the original type.
unpackToplevelConstr :: EType -> [EType] Source #
class IsElmDefinition a where Source #
compileElmDef :: Proxy a -> ETypeDef Source #
newtype SumEncoding' Source #
Instances
Eq SumEncoding' Source # | |
Defined in Elm.TyRep (==) :: SumEncoding' -> SumEncoding' -> Bool # (/=) :: SumEncoding' -> SumEncoding' -> Bool # | |
Ord SumEncoding' Source # | |
Defined in Elm.TyRep compare :: SumEncoding' -> SumEncoding' -> Ordering # (<) :: SumEncoding' -> SumEncoding' -> Bool # (<=) :: SumEncoding' -> SumEncoding' -> Bool # (>) :: SumEncoding' -> SumEncoding' -> Bool # (>=) :: SumEncoding' -> SumEncoding' -> Bool # max :: SumEncoding' -> SumEncoding' -> SumEncoding' # min :: SumEncoding' -> SumEncoding' -> SumEncoding' # | |
Show SumEncoding' Source # | |
Defined in Elm.TyRep showsPrec :: Int -> SumEncoding' -> ShowS # show :: SumEncoding' -> String # showList :: [SumEncoding'] -> ShowS # |
toElmType :: Typeable a => Proxy a -> EType Source #
Get an elm-bridge
type representation for a Haskell type.
This can be used to render the type declaration via
ElmRenderable
or the the JSON serializer/parser names via
jsonSerForType
and jsonParserForType
.