From 21e6e5940ecb462436b8dc94428c5cee5cdc9072 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 27 Sep 2024 16:20:32 -0600 Subject: Add import resolution phase and also add a more abstractions around compliation phases. --- src/Language/Fiddle/GenericTree.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Language/Fiddle/GenericTree.hs') 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) => -- cgit