| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Elm.TyRep
Description
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 {
- tc_name :: String
- newtype ETVar = ETVar {
- tv_name :: String
- 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
- isEmpty :: SumTypeFields -> Bool
- data SumTypeConstructor = STC {
- _stcName :: String
- _stcEncoded :: String
- _stcFields :: SumTypeFields
- data ESum = ESum {
- es_name :: ETypeName
- es_constructors :: [SumTypeConstructor]
- es_type :: SumEncoding'
- es_omit_null :: Bool
- es_unary_strings :: Bool
- 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.
Constructors
| ETypeAlias EAlias | |
| ETypePrimAlias EPrimAlias | |
| ETypeSum ESum |
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 #
Constructors
| EPrimAlias | |
Instances
| ElmRenderable EPrimAlias Source # | |
Defined in Elm.TyRender Methods renderElm :: EPrimAlias -> String Source # | |
| Show EPrimAlias Source # | |
Defined in Elm.TyRep Methods showsPrec :: Int -> EPrimAlias -> ShowS show :: EPrimAlias -> String showList :: [EPrimAlias] -> ShowS | |
| Eq EPrimAlias Source # | |
Defined in Elm.TyRep | |
| Ord EPrimAlias Source # | |
Defined in Elm.TyRep Methods compare :: EPrimAlias -> EPrimAlias -> Ordering (<) :: EPrimAlias -> EPrimAlias -> Bool (<=) :: EPrimAlias -> EPrimAlias -> Bool (>) :: EPrimAlias -> EPrimAlias -> Bool (>=) :: EPrimAlias -> EPrimAlias -> Bool max :: EPrimAlias -> EPrimAlias -> EPrimAlias min :: EPrimAlias -> EPrimAlias -> EPrimAlias | |
Constructors
| EAlias | |
Fields
| |
data SumTypeFields Source #
Instances
| Show SumTypeFields Source # | |
Defined in Elm.TyRep Methods showsPrec :: Int -> SumTypeFields -> ShowS show :: SumTypeFields -> String showList :: [SumTypeFields] -> ShowS | |
| Eq SumTypeFields Source # | |
Defined in Elm.TyRep | |
| Ord SumTypeFields Source # | |
Defined in Elm.TyRep Methods compare :: SumTypeFields -> SumTypeFields -> Ordering (<) :: SumTypeFields -> SumTypeFields -> Bool (<=) :: SumTypeFields -> SumTypeFields -> Bool (>) :: SumTypeFields -> SumTypeFields -> Bool (>=) :: SumTypeFields -> SumTypeFields -> Bool max :: SumTypeFields -> SumTypeFields -> SumTypeFields min :: SumTypeFields -> SumTypeFields -> SumTypeFields | |
isNamed :: SumTypeFields -> Bool Source #
isEmpty :: SumTypeFields -> Bool Source #
data SumTypeConstructor Source #
Constructors
| STC | |
Fields
| |
Instances
| Show SumTypeConstructor Source # | |
Defined in Elm.TyRep Methods showsPrec :: Int -> SumTypeConstructor -> ShowS show :: SumTypeConstructor -> String showList :: [SumTypeConstructor] -> ShowS | |
| Eq SumTypeConstructor Source # | |
Defined in Elm.TyRep Methods (==) :: SumTypeConstructor -> SumTypeConstructor -> Bool (/=) :: SumTypeConstructor -> SumTypeConstructor -> Bool | |
| Ord SumTypeConstructor Source # | |
Defined in Elm.TyRep Methods compare :: SumTypeConstructor -> SumTypeConstructor -> Ordering (<) :: SumTypeConstructor -> SumTypeConstructor -> Bool (<=) :: SumTypeConstructor -> SumTypeConstructor -> Bool (>) :: SumTypeConstructor -> SumTypeConstructor -> Bool (>=) :: SumTypeConstructor -> SumTypeConstructor -> Bool max :: SumTypeConstructor -> SumTypeConstructor -> SumTypeConstructor min :: SumTypeConstructor -> SumTypeConstructor -> SumTypeConstructor | |
Constructors
| ESum | |
Fields
| |
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 #
Methods
compileElmDef :: Proxy a -> ETypeDef Source #
newtype SumEncoding' Source #
Constructors
| SumEncoding' SumEncoding |
Instances
| Show SumEncoding' Source # | |
Defined in Elm.TyRep Methods showsPrec :: Int -> SumEncoding' -> ShowS show :: SumEncoding' -> String showList :: [SumEncoding'] -> ShowS | |
| Eq SumEncoding' Source # | |
Defined in Elm.TyRep | |
| Ord SumEncoding' Source # | |
Defined in Elm.TyRep Methods compare :: SumEncoding' -> SumEncoding' -> Ordering (<) :: SumEncoding' -> SumEncoding' -> Bool (<=) :: SumEncoding' -> SumEncoding' -> Bool (>) :: SumEncoding' -> SumEncoding' -> Bool (>=) :: SumEncoding' -> SumEncoding' -> Bool max :: SumEncoding' -> SumEncoding' -> SumEncoding' min :: SumEncoding' -> SumEncoding' -> SumEncoding' | |
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.