aboutsummaryrefslogtreecommitdiffstats
path: root/style-generator/src/MyElm/Types.elm
diff options
context:
space:
mode:
Diffstat (limited to 'style-generator/src/MyElm/Types.elm')
-rw-r--r--style-generator/src/MyElm/Types.elm56
1 files changed, 56 insertions, 0 deletions
diff --git a/style-generator/src/MyElm/Types.elm b/style-generator/src/MyElm/Types.elm
new file mode 100644
index 0000000..ef473e4
--- /dev/null
+++ b/style-generator/src/MyElm/Types.elm
@@ -0,0 +1,56 @@
+module MyElm.Types exposing (Argument(..), Declaration(..), Exposing(..), Expression(..), Ident(..), Module(..), QualifiedName(..), Type(..))
+
+
+type Module
+ = Module
+ { name : String
+ , exposes : List Exposing
+ , doc : Maybe String
+ , imports : List String
+ , declarations : List Declaration
+ }
+
+
+type QualifiedName
+ = Local Ident
+ | FullyQualified (List String) Ident
+ | Aliased (List String) String Ident
+ | Bare (List String) Ident
+
+
+type Ident
+ = Constructor String String
+ | ValueOrType String
+
+
+type Exposing
+ = ValueExposed String
+ | TypeExposed String
+ | TypeAndConstructors String
+
+
+type Type
+ = NamedType QualifiedName (List Type)
+ | RecordType (List ( String, Type ))
+ | FunctionType (List Type)
+ | TupleType (List Type)
+ | TypeVariable String
+
+
+type Declaration
+ = CustomType String (List String) (List ( String, List Type ))
+ | TypeAlias String (List String) Type
+ | ValueDeclaration String (List Type) (List Argument) Expression
+ | Comment String
+
+
+type Expression
+ = Call QualifiedName (List Expression)
+ | Literal String
+ | ListExpr (List Expression)
+ | Tuple (List Expression)
+ | Record (List ( String, Expression ))
+
+
+type Argument
+ = Argument String