summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/Ast/Internal/Kinds.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/Fiddle/Ast/Internal/Kinds.hs')
-rw-r--r--src/Language/Fiddle/Ast/Internal/Kinds.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Language/Fiddle/Ast/Internal/Kinds.hs b/src/Language/Fiddle/Ast/Internal/Kinds.hs
new file mode 100644
index 0000000..1368c84
--- /dev/null
+++ b/src/Language/Fiddle/Ast/Internal/Kinds.hs
@@ -0,0 +1,25 @@
+
+module Language.Fiddle.Ast.Internal.Kinds where
+
+import Data.Kind (Type)
+import Language.Fiddle.Ast.Internal.Stage
+
+-- The Kind types should have for SyntaxTrees.
+--
+-- A synatx tree kind should take as parameters, an applicative functor for the
+-- first argument. This applicative functor allows errors and warnings to be
+-- contained to their deferred regions during compilation, so more errors may be
+-- reported an once.
+--
+-- The second argument is the annotation type. Every syntax tree element has an
+-- annotation. When initially parsing, this annotation is a list of comments
+-- that came before the element and the source position of the element.
+--
+-- SynTree types are not dependent on the compilation stage. They're the same
+-- regardless of the compilation stage.
+type SynTree = (Type -> Type) -> Type -> Type
+
+-- A syntax tree which is dependent on the stage in compilation. As compilations
+-- progress through stages, types in the syntax tree may change as things become
+-- more and more machine readable.
+type StagedSynTree = Stage -> SynTree