elm-bridge-0.8.4: Derive Elm types and Json code from Haskell types, using aeson's options
Safe HaskellNone
LanguageHaskell2010

Elm.TyRep

Description

This module defines how the derived Haskell data types are represented. - It is useful for writing type conversion rules.

Synopsis

Documentation

data ETypeDef Source #

Type definition, including constructors.

Instances

Instances details
ElmRenderable ETypeDef Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: ETypeDef -> String Source #

Show ETypeDef Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> ETypeDef -> ShowS

show :: ETypeDef -> String

showList :: [ETypeDef] -> ShowS

Eq ETypeDef Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: ETypeDef -> ETypeDef -> Bool

(/=) :: ETypeDef -> ETypeDef -> Bool

data EType Source #

Type construction : type variables, type constructors, tuples and type application.

Instances

Instances details
ElmRenderable EType Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: EType -> String Source #

Show EType Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> EType -> ShowS

show :: EType -> String

showList :: [EType] -> ShowS

Eq EType Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: EType -> EType -> Bool

(/=) :: EType -> EType -> Bool

Ord EType Source # 
Instance details

Defined in Elm.TyRep

Methods

compare :: EType -> EType -> Ordering

(<) :: EType -> EType -> Bool

(<=) :: EType -> EType -> Bool

(>) :: EType -> EType -> Bool

(>=) :: EType -> EType -> Bool

max :: EType -> EType -> EType

min :: EType -> EType -> EType

newtype ETCon Source #

Type constructor:

ETCon "Int"

Constructors

ETCon 

Fields

Instances

Instances details
ElmRenderable ETCon Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: ETCon -> String Source #

Show ETCon Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> ETCon -> ShowS

show :: ETCon -> String

showList :: [ETCon] -> ShowS

Eq ETCon Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: ETCon -> ETCon -> Bool

(/=) :: ETCon -> ETCon -> Bool

Ord ETCon Source # 
Instance details

Defined in Elm.TyRep

Methods

compare :: ETCon -> ETCon -> Ordering

(<) :: ETCon -> ETCon -> Bool

(<=) :: ETCon -> ETCon -> Bool

(>) :: ETCon -> ETCon -> Bool

(>=) :: ETCon -> ETCon -> Bool

max :: ETCon -> ETCon -> ETCon

min :: ETCon -> ETCon -> ETCon

newtype ETVar Source #

Type variable:

ETVar "a"

Constructors

ETVar 

Fields

Instances

Instances details
ElmRenderable ETVar Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: ETVar -> String Source #

Show ETVar Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> ETVar -> ShowS

show :: ETVar -> String

showList :: [ETVar] -> ShowS

Eq ETVar Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: ETVar -> ETVar -> Bool

(/=) :: ETVar -> ETVar -> Bool

Ord ETVar Source # 
Instance details

Defined in Elm.TyRep

Methods

compare :: ETVar -> ETVar -> Ordering

(<) :: ETVar -> ETVar -> Bool

(<=) :: ETVar -> ETVar -> Bool

(>) :: ETVar -> ETVar -> Bool

(>=) :: ETVar -> ETVar -> Bool

max :: ETVar -> ETVar -> ETVar

min :: ETVar -> ETVar -> ETVar

data ETypeName Source #

Type name:

ETypeName "Map" [ETVar "k", ETVar "v"]

Constructors

ETypeName 

Fields

Instances

Instances details
ElmRenderable ETypeName Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: ETypeName -> String Source #

Show ETypeName Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> ETypeName -> ShowS

show :: ETypeName -> String

showList :: [ETypeName] -> ShowS

Eq ETypeName Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: ETypeName -> ETypeName -> Bool

(/=) :: ETypeName -> ETypeName -> Bool

Ord ETypeName Source # 
Instance details

Defined in Elm.TyRep

Methods

compare :: ETypeName -> ETypeName -> Ordering

(<) :: ETypeName -> ETypeName -> Bool

(<=) :: ETypeName -> ETypeName -> Bool

(>) :: ETypeName -> ETypeName -> Bool

(>=) :: ETypeName -> ETypeName -> Bool

max :: ETypeName -> ETypeName -> ETypeName

min :: ETypeName -> ETypeName -> ETypeName

data EPrimAlias Source #

Constructors

EPrimAlias 

Instances

Instances details
ElmRenderable EPrimAlias Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: EPrimAlias -> String Source #

Show EPrimAlias Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> EPrimAlias -> ShowS

show :: EPrimAlias -> String

showList :: [EPrimAlias] -> ShowS

Eq EPrimAlias Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: EPrimAlias -> EPrimAlias -> Bool

(/=) :: EPrimAlias -> EPrimAlias -> Bool

Ord EPrimAlias Source # 
Instance details

Defined in Elm.TyRep

data EAlias Source #

Constructors

EAlias 

Fields

Instances

Instances details
ElmRenderable EAlias Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: EAlias -> String Source #

Show EAlias Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> EAlias -> ShowS

show :: EAlias -> String

showList :: [EAlias] -> ShowS

Eq EAlias Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: EAlias -> EAlias -> Bool

(/=) :: EAlias -> EAlias -> Bool

Ord EAlias Source # 
Instance details

Defined in Elm.TyRep

Methods

compare :: EAlias -> EAlias -> Ordering

(<) :: EAlias -> EAlias -> Bool

(<=) :: EAlias -> EAlias -> Bool

(>) :: EAlias -> EAlias -> Bool

(>=) :: EAlias -> EAlias -> Bool

max :: EAlias -> EAlias -> EAlias

min :: EAlias -> EAlias -> EAlias

data SumTypeFields Source #

Constructors

Anonymous [EType] 
Named [(String, EType)] 

Instances

Instances details
Show SumTypeFields Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> SumTypeFields -> ShowS

show :: SumTypeFields -> String

showList :: [SumTypeFields] -> ShowS

Eq SumTypeFields Source # 
Instance details

Defined in Elm.TyRep

Ord SumTypeFields Source # 
Instance details

Defined in Elm.TyRep

data ESum Source #

Instances

Instances details
ElmRenderable ESum Source # 
Instance details

Defined in Elm.TyRender

Methods

renderElm :: ESum -> String Source #

Show ESum Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> ESum -> ShowS

show :: ESum -> String

showList :: [ESum] -> ShowS

Eq ESum Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: ESum -> ESum -> Bool

(/=) :: ESum -> ESum -> Bool

Ord ESum Source # 
Instance details

Defined in Elm.TyRep

Methods

compare :: ESum -> ESum -> Ordering

(<) :: ESum -> ESum -> Bool

(<=) :: ESum -> ESum -> Bool

(>) :: ESum -> ESum -> Bool

(>=) :: ESum -> ESum -> Bool

max :: ESum -> ESum -> ESum

min :: ESum -> ESum -> ESum

unpackTupleType :: EType -> [EType] Source #

Transforms tuple types in a list of types. Otherwise returns a singleton list with the original type.

class IsElmDefinition a where Source #

Methods

compileElmDef :: Proxy a -> ETypeDef Source #

newtype SumEncoding' Source #

Instances

Instances details
Show SumEncoding' Source # 
Instance details

Defined in Elm.TyRep

Methods

showsPrec :: Int -> SumEncoding' -> ShowS

show :: SumEncoding' -> String

showList :: [SumEncoding'] -> ShowS

Eq SumEncoding' Source # 
Instance details

Defined in Elm.TyRep

Methods

(==) :: SumEncoding' -> SumEncoding' -> Bool

(/=) :: SumEncoding' -> SumEncoding' -> Bool

Ord SumEncoding' Source # 
Instance details

Defined in Elm.TyRep

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.