| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Elm.Ast
Description
AST representing structure of Elm types. Haskell generic representation is converted to this AST which later is going to be pretty-printed.
Synopsis
- data ElmDefinition
- data ElmRecord = ElmRecord {}
- data ElmType = ElmType {
- elmTypeName :: !Text
- elmTypeVars :: ![Text]
- elmTypeIsNewtype :: !Bool
- elmTypeConstructors :: !(NonEmpty ElmConstructor)
- data ElmPrim
- data ElmRecordField = ElmRecordField {}
- data ElmConstructor = ElmConstructor {}
- isEnum :: ElmType -> Bool
- getConstructorNames :: ElmType -> [Text]
- newtype TypeName = TypeName {
- unTypeName :: Text
- data TypeRef
- definitionToRef :: ElmDefinition -> TypeRef
Documentation
data ElmDefinition Source #
Elm data type definition.
Instances
| Show ElmDefinition Source # | |
Defined in Elm.Ast Methods showsPrec :: Int -> ElmDefinition -> ShowS # show :: ElmDefinition -> String # showList :: [ElmDefinition] -> ShowS # | |
AST for record type alias in Elm.
Constructors
| ElmRecord | |
Fields
| |
AST for type in Elm.
Constructors
| ElmType | |
Fields
| |
Primitive elm types; hardcoded by the language.
Constructors
| ElmUnit |
|
| ElmNever |
|
| ElmBool | Bool |
| ElmChar | Char |
| ElmInt | Int |
| ElmFloat | Float |
| ElmString | String |
| ElmTime |
|
| ElmValue |
|
| ElmMaybe !TypeRef | Maybe T |
| ElmResult !TypeRef !TypeRef |
|
| ElmPair !TypeRef !TypeRef |
|
| ElmTriple !TypeRef !TypeRef !TypeRef |
|
| ElmList !TypeRef |
|
| ElmNonEmptyPair !TypeRef |
|
data ElmRecordField Source #
Single field of record type alias.
Constructors
| ElmRecordField | |
Fields | |
Instances
| Show ElmRecordField Source # | |
Defined in Elm.Ast Methods showsPrec :: Int -> ElmRecordField -> ShowS # show :: ElmRecordField -> String # showList :: [ElmRecordField] -> ShowS # | |
data ElmConstructor Source #
Constructor of type.
Constructors
| ElmConstructor | |
Fields
| |
Instances
| Show ElmConstructor Source # | |
Defined in Elm.Ast Methods showsPrec :: Int -> ElmConstructor -> ShowS # show :: ElmConstructor -> String # showList :: [ElmConstructor] -> ShowS # | |
getConstructorNames :: ElmType -> [Text] Source #
Gets the list of the constructor names.
Wrapper for name of the type.
Constructors
| TypeName | |
Fields
| |
Reference to another existing type.
definitionToRef :: ElmDefinition -> TypeRef Source #
Extracts reference to the existing data type type from some other type elm defintion.