diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-09-27 16:20:32 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-09-27 16:24:10 -0600 |
commit | 21e6e5940ecb462436b8dc94428c5cee5cdc9072 (patch) | |
tree | 01405c637f904f24feadc177a84ab9bae7c8c99c /src/Language/Fiddle/GenericTree.hs | |
parent | a4cffc1eeb547f780068875a703251db6aa41d6c (diff) | |
download | fiddle-21e6e5940ecb462436b8dc94428c5cee5cdc9072.tar.gz fiddle-21e6e5940ecb462436b8dc94428c5cee5cdc9072.tar.bz2 fiddle-21e6e5940ecb462436b8dc94428c5cee5cdc9072.zip |
Add import resolution phase and also add a more abstractions around
compliation phases.
Diffstat (limited to 'src/Language/Fiddle/GenericTree.hs')
-rw-r--r-- | src/Language/Fiddle/GenericTree.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Language/Fiddle/GenericTree.hs b/src/Language/Fiddle/GenericTree.hs index 031f6ab..ef53e31 100644 --- a/src/Language/Fiddle/GenericTree.hs +++ b/src/Language/Fiddle/GenericTree.hs @@ -32,9 +32,8 @@ import Text.Printf (printf) type Context stage = ( Show (NumberType stage), Typeable stage, - ToGenericSyntaxTree (ImportType stage), - Typeable (ImportType stage), - ToGenericSyntaxTreeValue (NumberType stage) + ToGenericSyntaxTreeValue (NumberType stage), + Show (ImportInterface stage) ) data GenericSyntaxTree f a where @@ -124,7 +123,7 @@ class ToGenericSyntaxTreeValue v where instance ToGenericSyntaxTreeValue Data.Text.Text where toGenericSyntaxTreeValue = Just . SyntaxTreeValue . Data.Text.unpack -instance (Show s, Num s) => ToGenericSyntaxTreeValue s where +instance (Show s) => ToGenericSyntaxTreeValue s where toGenericSyntaxTreeValue = Just . SyntaxTreeValue . show -- Witnesses exist just for type level meta programming, don't return anything @@ -228,7 +227,7 @@ deriving instance (ToGenericSyntaxTree DirectiveExpression) deriving instance (ToGenericSyntaxTree ImportList) -deriving instance (ToGenericSyntaxTree ImportStatement) +deriving instance (Context stage) => (ToGenericSyntaxTree (ImportStatement stage)) deriving instance (Context stage, ToGenericSyntaxTree (t stage), Typeable t) => |