Commit 869c3a2e authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Module Base removed, Module Eval renamed to Base.Eval

parent 7ce864ed
......@@ -39,8 +39,8 @@ Executable cymake
, mtl, old-time, containers, pretty
ghc-options: -Wall
Other-Modules:
Base
, Base.Arity
Base.Arity
, Base.Eval
, Base.Import
, Base.Module
, Base.OpPrec
......@@ -77,7 +77,6 @@ Executable cymake
, CurryCompilerOpts
, CurryDeps
, CurryToIL
, Eval
, Exports
, Frontend
, Imports
......
This diff is collapsed.
......@@ -11,7 +11,7 @@ environment. There is no need to check the annotations because this
happens already while checking the definitions of the module.
\begin{verbatim}
> module Eval (EvalEnv, evalEnv) where
> module Base.Eval (EvalEnv, evalEnv) where
> import qualified Data.Map as Map
......
......@@ -31,8 +31,10 @@ data structures, we can use only a qualified import for the
> import qualified Curry.IL as IL
> import Curry.Syntax
> import Base
> import Eval (EvalEnv)
> import Base.Eval (EvalEnv)
> import Base.TypeConstructors (TCEnv, TypeInfo (..), qualLookupTC)
> import Base.Types (toQualTypes)
> import Base.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
> import Messages (internalError)
> import Utils (foldr2, thd3)
> import Types
......
......@@ -8,7 +8,8 @@ module Env.CurryEnv (CurryEnv (..), curryEnv) where
import Data.Maybe
import Types
import Base (ModuleEnv, TCEnv, TypeInfo (..), qualLookupTC)
import Base.Module (ModuleEnv)
import Base.TypeConstructors(TCEnv, TypeInfo (..), qualLookupTC)
import Messages (internalError)
import Curry.Base.Position
......
......@@ -22,9 +22,10 @@ is computed.
> import Curry.Base.Ident
> import Curry.Syntax
> import Types
> import Base (PEnv, TCEnv, ValueEnv, PrecInfo (..), TypeInfo (..)
> , OpPrec (..), ValueInfo (..), fromQualType, lookupValue
> , qualLookupP, qualLookupTC, qualLookupValue)
> import Base.OpPrec (PEnv, PrecInfo (..), OpPrec (..), qualLookupP)
> import Base.TypeConstructors (TCEnv, TypeInfo (..), qualLookupTC)
> import Base.Types (fromQualType)
> import Base.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
> import Env.TopEnv
> import Messages (errorAt', internalError)
> import Utils (findDouble)
......
......@@ -21,7 +21,7 @@ import Modules (checkModule, simpleCheckModule, compileModule, importPrelude
import CurryBuilder (smake)
import CurryCompilerOpts (Options (..), defaultOptions)
import CurryDeps (flattenDeps, moduleDeps, Source (..))
import Base (ModuleEnv)
import Base.Module (ModuleEnv)
{- |Return the result of a syntactical analysis of the source program 'src'.
The result is the syntax tree of the program (type 'Module'; see Module
......@@ -54,7 +54,7 @@ genCurrySyntax fn mod1
| isValidModuleId fn mid = return mod'
| otherwise = failWith $ err_invalidModuleName mid
where
mod'@(CS.Module mid _ _) = patchModuleId fn (importPrelude fn mod1)
mod'@(CS.Module mid _ _) = patchModuleId fn (importPrelude defaultOptions fn mod1)
err_invalidModuleName :: ModuleIdent -> String
err_invalidModuleName m = "module \"" ++ moduleName m
......@@ -66,7 +66,7 @@ genCurrySyntax fn mod1
--
genFullCurrySyntax ::
(Options -> Base.ModuleEnv -> CS.Module -> IO (a, b, c, CS.Module, d, [WarnMsg]))
(Options -> ModuleEnv -> CS.Module -> IO (a, b, c, CS.Module, d, [WarnMsg]))
-> [FilePath] -> MsgMonad CS.Module -> IO (MsgMonad CS.Module)
genFullCurrySyntax check paths m = runMsgIO m $ \mod1 -> do
errs <- makeInterfaces paths mod1
......
......@@ -9,11 +9,14 @@
--
module Gen.GenFlatCurry (genFlatCurry, genFlatInterface) where
import Control.Monad.State
import Data.List
import qualified Data.Map as Map
import Data.Maybe
-- Haskell libraries
import Control.Monad (filterM, liftM, mplus, unless)
import Control.Monad.State (State, runState, gets, modify)
import Data.List (nub)
import qualified Data.Map as Map (Map, empty, insert, lookup, fromList, toList)
import Data.Maybe (catMaybes, fromJust, fromMaybe, isJust)
-- curry-base
import Curry.Base.MessageMonad
import Curry.Base.Ident as Id
import Curry.ExtendedFlat.Type
......@@ -21,9 +24,10 @@ import Curry.ExtendedFlat.TypeInference
import qualified Curry.IL as IL
import qualified Curry.Syntax as CS
import Base (ModuleEnv, TCEnv, ValueEnv, TypeInfo (..), ValueInfo (..)
, lookupValue, qualLookupTC, qualLookupValue, ArityEnv, ArityInfo (..)
, lookupArity, qualLookupArity)
import Base.Arity (ArityEnv, ArityInfo (..), lookupArity, qualLookupArity)
import Base.Module (ModuleEnv)
import Base.TypeConstructors (TCEnv, TypeInfo (..), qualLookupTC)
import Base.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
import CurryCompilerOpts (Options (..))
import qualified CurryToIL as IL
......
......@@ -34,10 +34,14 @@ This module controls the compilation of modules.
> import qualified Curry.IL as IL
> import Curry.Syntax
> import Base (ModuleEnv, PEnv, TCEnv, ValueEnv, TypeInfo (..), ValueInfo (..)
> , bindAlias, initDCEnv, initIEnv, initPEnv, initTCEnv, qualLookupTC
> , toType, fromQualType, ArityEnv, bindArities, initAEnv)
> import Base.Eval (evalEnv)
> import Base.Module (ModuleEnv)
> import Base.OpPrec (PEnv, initPEnv)
> import Base.TypeConstructors (TCEnv, TypeInfo (..), initTCEnv, qualLookupTC)
> import Base.Types (toType, fromQualType)
> import Base.Value (ValueEnv, ValueInfo (..), initDCEnv)
> import Base.Arity (ArityEnv, initAEnv, bindArities)
> import Base.Import (bindAlias, initIEnv)
> import Check.InterfaceCheck (interfaceCheck)
> import Check.KindCheck (kindCheck)
> import Check.SyntaxCheck (syntaxCheck)
......@@ -59,7 +63,6 @@ This module controls the compilation of modules.
> import CurryCompilerOpts (Options (..), Dump (..))
> import CurryToIL (ilTrans)
> import Eval (evalEnv)
> import Exports (expandInterface, exportInterface)
> import Imports (importInterface, importInterfaceIntf, importUnifyData)
> import Messages (errorAt, internalError)
......@@ -146,11 +149,6 @@ Haskell and original MCC where a module obtains \texttt{main}).
> | otherwise
> = m
> loadInterfaces :: [FilePath] -> Module -> IO ModuleEnv
> loadInterfaces paths (Module m _ ds) =
> foldM (loadInterface paths [m]) Map.empty
> [(p, m') | ImportDecl p m' _ _ _ <- ds]
> checkModuleId :: Monad m => FilePath -> Module -> m ()
> checkModuleId fn (Module mid _ _)
> | last (moduleQualifiers mid) == takeBaseName fn
......@@ -170,9 +168,9 @@ only a qualified import is added.
> importPrelude :: Options -> FilePath -> Module -> Module
> importPrelude opts fn (Module m es ds)
> | m == preludeMIdent = Module m es ds
> | xNoImplicitPrelude = Module m es ds
> | otherwise = Module m es ds'
> | m == preludeMIdent = Module m es ds
> | xNoImplicitPrelude opts = Module m es ds
> | otherwise = Module m es ds'
> where ids = [decl | decl@(ImportDecl _ _ _ _ _) <- ds]
> ds' = ImportDecl (first fn) preludeMIdent
> (preludeMIdent `elem` map importedModule ids)
......
......@@ -28,9 +28,9 @@ lifted to the top-level.
> import Curry.Base.Ident
> import Curry.Syntax
> import Base.Eval (EvalEnv)
> import Base.Value (ValueEnv, ValueInfo (..), lookupValue)
> import Env.TopEnv
> import Eval (EvalEnv)
> import Messages (internalError)
> import SCC
> import Types
......
......@@ -33,8 +33,8 @@ Currently, the following optimizations are implemented:
> import Curry.Base.Ident
> import Curry.Syntax
> import Base.Eval (EvalEnv)
> import Base.Value (ValueEnv, ValueInfo (..), bindFun, qualLookupValue)
> import Eval (EvalEnv)
> import Messages (internalError)
> import SCC
> import Types
......
......@@ -17,7 +17,7 @@
> import Curry.Syntax
> import Types
> import Base (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
> import Base.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
> import TypeSubst
> import Env.TopEnv
> import Utils
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment