From c7cc8467ca1835c8f96ccb5be7c976a26d262433 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Wed, 20 Dec 2023 19:53:05 +0000 Subject: Updated to use GHC 9.4.x and floating dependencies --- src/Micro/Env.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Micro/Env.hs') diff --git a/src/Micro/Env.hs b/src/Micro/Env.hs index 731f19a..b788214 100644 --- a/src/Micro/Env.hs +++ b/src/Micro/Env.hs @@ -1,8 +1,8 @@ module Micro.Env where -import qualified Data.Map as Map +import Data.Map qualified as Map import Data.Maybe (isJust) -import qualified Micro.Ast as A +import Micro.Ast qualified as A import Micro.Error import Text.Parsec (SourcePos) @@ -56,9 +56,9 @@ existsSyml env sym = isJust $ getSyml env sym -- environment. It will create a new enviroment if the symbol already exists -- (shadowing). addSym :: Env -> Sym -> Env -addSym env@(Env m parent) sym = case getSym env (symId sym) of - Nothing -> Env (Map.insert (symId sym) sym m) parent - Just _ -> Env (Map.singleton (symId sym) sym) $ Just env +addSym env@(Env m parent) sym = case getSym env sym.symId of + Nothing -> Env (Map.insert sym.symId sym m) parent + Just _ -> Env (Map.singleton sym.symId sym) $ Just env -- | @addEnv e@ adds a new local environment using @e@ as parent. addEnv :: Env -> Env @@ -67,6 +67,6 @@ addEnv env = Env Map.empty $ Just env -- | @addSymUniq e s@ adds a local symbol @s@ to the enviroment @e@ if it -- doesn't exist. addSymUniq :: Env -> Sym -> Either Error Env -addSymUniq ev sym = case getSyml ev (symId sym) of +addSymUniq ev sym = case getSyml ev sym.symId of Nothing -> Right $ addSym ev sym - Just other -> Left $ Error AlreadyDefined ("\"" ++ symId sym ++ "\" already defined in " ++ show (symPos other)) $ symPos sym + Just other -> Left $ Error AlreadyDefined ("\"" ++ sym.symId ++ "\" already defined in " ++ show other.symPos) sym.symPos -- cgit v1.2.3