diff options
Diffstat (limited to 'src/Language/AST.hs')
-rw-r--r-- | src/Language/AST.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Language/AST.hs b/src/Language/AST.hs index 022e797..387915b 100644 --- a/src/Language/AST.hs +++ b/src/Language/AST.hs @@ -17,7 +17,7 @@ module Language.AST where import Data.Kind (Type) import Data.Type.Equality import GHC.OverloadedLabels -import GHC.TypeLits (Symbol, SSymbol, symbolSing, KnownSymbol, TypeError, ErrorMessage(Text)) +import GHC.TypeLits (Symbol, SSymbol, symbolSing, KnownSymbol, TypeError, ErrorMessage(..)) import Array import AST @@ -77,6 +77,7 @@ deriving instance Show (NExpr env t) type family Lookup name env where Lookup "_" _ = TypeError (Text "Attempt to use variable with name '_'") + Lookup name '[] = TypeError (Text "Variable '" :<>: Text name :<>: Text "' not in scope") Lookup name ('(name, t) : env) = t Lookup name (_ : env) = Lookup name env |