blob: 1368c841b7a6f4f4da41d58b7940c245bbbac40f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
|