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

Compiler options improved

parent 6675c3f1
...@@ -74,7 +74,7 @@ Executable cymake ...@@ -74,7 +74,7 @@ Executable cymake
, Html.CurryHtml , Html.CurryHtml
, Html.SyntaxColoring , Html.SyntaxColoring
, CurryBuilder , CurryBuilder
, CurryCompilerOpts , CompilerOpts
, CurryDeps , CurryDeps
, CurryToIL , CurryToIL
, Exports , Exports
......
{- |CurryCompilerOpts - Defines data structures containing options for {- |CompilerOpts - Defines data structures containing options for
compiling Curry programs (see module "CurryCompiler") compiling Curry programs (see module "CurryCompiler")
September 2005, Martin Engelke (men@informatik.uni-kiel.de) September 2005, Martin Engelke (men@informatik.uni-kiel.de)
March 2007 , extensions by Sebastian Fischer (sebf@informatik.uni-kiel.de) March 2007 , extensions by Sebastian Fischer (sebf@informatik.uni-kiel.de)
May 2011 , refinements by Björn Peemöller (bjp@informatik.uni-kiel.de) May 2011 , refinements by Bjoern Peemoeller (bjp@informatik.uni-kiel.de)
-} -}
module CurryCompilerOpts module CompilerOpts
(Options (..), Dump (..), defaultOptions, compilerOpts, usage) where ( Options (..), Verbosity (..), TargetType (..), Extension (..)
, DumpLevel (..), defaultOptions, compilerOpts, usage
) where
import Data.List (nub) import Data.List (nub)
import Data.Maybe (isJust) import Data.Maybe (isJust)
...@@ -17,33 +19,66 @@ import Curry.Files.Filenames (currySubdir) ...@@ -17,33 +19,66 @@ import Curry.Files.Filenames (currySubdir)
-- |Data type for recording compiler options -- |Data type for recording compiler options
data Options = Options data Options = Options
{ help :: Bool -- ^ show help -- general
, version :: Bool -- ^ show the version { optHelp :: Bool -- ^ show help
, force :: Bool -- ^ force compilation , optVersion :: Bool -- ^ show the version
, html :: Bool -- ^ generate Html code , optHtml :: Bool -- ^ generate Html code
, importPaths :: [FilePath] -- ^ directories for imports , optVerbosity :: Verbosity -- ^ verbosity level
, output :: Maybe FilePath -- ^ name of output file -- compilation
, noInterface :: Bool -- ^ do not create an interface file , optForce :: Bool -- ^ force compilation
, noVerb :: Bool -- ^ verbosity on/off , optImportPaths :: [FilePath] -- ^ directories for imports
, noWarn :: Bool -- ^ warnings on/off , optOutput :: Maybe FilePath -- ^ name of output file
, noOverlapWarn :: Bool -- ^ "overlap" warnings on/off , optUseSubdir :: Bool -- use subdir for output?
, flat :: Bool -- ^ generate FlatCurry code , optInterface :: Bool -- ^ do not create an interface file
, extendedFlat :: Bool -- ^ generate FlatCurry code with extensions , optWarn :: Bool -- ^ warnings on/off
, flatXml :: Bool -- ^ generate flat XML code , optOverlapWarn :: Bool -- ^ "overlap" warnings on/off
, abstract :: Bool -- ^ generate typed AbstracCurry code , optTargetTypes :: [TargetType] -- ^ what to generate
, untypedAbstract :: Bool -- ^ generate untyped AbstractCurry code , optExtensions :: [Extension] -- ^ language extensions
, parseOnly :: Bool -- ^ generate source representation , optDumps :: [DumpLevel] -- ^ dumps
, withExtensions :: Bool -- ^ enable extended functionalities } -- deriving Show
, dump :: [Dump] -- ^ dumps
, writeToSubdir :: Bool -- ^ should the output be written to the subdir? -- | Default compiler options
, xNoImplicitPrelude :: Bool -- ^ extension: no implicit import Prelude defaultOptions :: Options
} deriving Show defaultOptions = Options
{ optHelp = False
, optVersion = False
, optHtml = False
, optVerbosity = Verbose
, optForce = False
, optImportPaths = []
, optOutput = Nothing
, optUseSubdir = True
, optInterface = True
, optWarn = True
, optOverlapWarn = True
, optTargetTypes = []
, optExtensions = []
, optDumps = []
}
data TargetType
= Parsed
| FlatCurry
| ExtendedFlatCurry
| FlatXml
| AbstractCurry
| UntypedAbstractCurry
deriving Eq
data Verbosity
= Quiet
| Verbose
deriving Eq
classifyVerbosity :: String -> Verbosity
classifyVerbosity "0" = Quiet
classifyVerbosity _ = Verbose
-- TODO: dump FlatCurry code, dump AbstractCurry code, dump after 'case' -- TODO: dump FlatCurry code, dump AbstractCurry code, dump after 'case'
-- expansion -- expansion
-- |Data type for representing code dumps -- |Data type for representing code dumps
data Dump data DumpLevel
= DumpRenamed -- ^ dump source after renaming = DumpRenamed -- ^ dump source after renaming
| DumpTypes -- ^ dump types after typechecking | DumpTypes -- ^ dump types after typechecking
| DumpDesugared -- ^ dump source after desugaring | DumpDesugared -- ^ dump source after desugaring
...@@ -53,117 +88,114 @@ data Dump ...@@ -53,117 +88,114 @@ data Dump
| DumpCase -- ^ dump IL code after case elimination | DumpCase -- ^ dump IL code after case elimination
deriving (Eq, Bounded, Enum, Show) deriving (Eq, Bounded, Enum, Show)
-- | Default compiler options dumpAll :: [DumpLevel]
defaultOptions :: Options dumpAll = [minBound .. maxBound]
defaultOptions = Options
{ help = False -- |Data type representing language extensions
, version = False data Extension
, force = False = BerndExtension -- TODO: Give it a more concise name
, html = False | NoImplicitPrelude
, importPaths = [] | AnonymousFreeVariables
, output = Nothing | UnknownExtension String
, noInterface = False deriving (Eq, Read, Show)
, noVerb = False
, noWarn = False classifyExtension :: String -> Extension
, noOverlapWarn = False classifyExtension str = case readsPrec 0 str of
, flat = False [(e, "")] -> e
, extendedFlat = False _ -> UnknownExtension str
, flatXml = False
, abstract = False
, untypedAbstract = False
, parseOnly = False
, withExtensions = False
, dump = []
, writeToSubdir = True
, xNoImplicitPrelude = False
}
-- | All available compiler options -- | All available compiler options
options :: [OptDescr (Options -> Options)] options :: [OptDescr (Options -> Options)]
options = options =
-- general
[ Option "h?" ["help"] [ Option "h?" ["help"]
(NoArg (\opts -> opts { help = True })) (NoArg (\opts -> opts { optHelp = True }))
"display this help and exit" "display this help and exit"
, Option "V" ["version"] , Option "V" ["version"]
(NoArg (\opts -> opts { version = True })) (NoArg (\opts -> opts { optVersion = True }))
"show the version number" "show the version number"
, Option "f" ["force"]
(NoArg (\opts -> opts { force = True }))
"force compilation of dependent files"
, Option "" ["html"] , Option "" ["html"]
(NoArg (\opts -> opts { html = True })) (NoArg (\opts -> opts { optHtml = True }))
"generate html code" "generate html code"
, Option "v" ["verbosity"]
(ReqArg (\arg opts -> opts { optVerbosity = classifyVerbosity arg }) "<n>")
"set verbosity level to <n>"
-- compilation
, Option "f" ["force"]
(NoArg (\opts -> opts { optForce = True }))
"force compilation of dependent files"
, Option "i" ["import-dir"] , Option "i" ["import-dir"]
(ReqArg (\arg opts -> opts { importPaths = nub $ arg : importPaths opts }) "DIR") (ReqArg (\arg opts -> opts { optImportPaths = nub $ arg : optImportPaths opts }) "DIR")
"search for imports in DIR" "search for imports in DIR"
, Option "o" ["output"] , Option "o" ["output"]
(ReqArg (\arg opts -> opts { output = Just arg }) "FILE") (ReqArg (\arg opts -> opts { optOutput = Just arg }) "FILE")
"write code to FILE" "write code to FILE"
, Option "" ["no-subdir"]
(NoArg (\opts -> opts { optUseSubdir = False }))
("disable writing to '" ++ currySubdir ++ "' subdirectory")
, Option "" ["no-intf"] , Option "" ["no-intf"]
(NoArg (\opts -> opts { noInterface = True })) (NoArg (\opts -> opts { optInterface = False }))
"do not create an interface file" "do not create an interface file"
, Option "" ["no-verb"]
(NoArg (\opts -> opts { noVerb = True }))
"do not print compiler messages"
, Option "" ["no-warn"] , Option "" ["no-warn"]
(NoArg (\opts -> opts { noWarn = True })) (NoArg (\opts -> opts { optWarn = False }))
"do not print warnings" "do not print warnings"
, Option "" ["no-overlap-warn"] , Option "" ["no-overlap-warn"]
(NoArg (\opts -> opts { noOverlapWarn = True })) (NoArg (\opts -> opts { optOverlapWarn = False }))
"do not print warnings for overlapping rules" "do not print warnings for overlapping rules"
-- target types
, Option "" ["parse-only"]
(NoArg (\opts -> opts { optTargetTypes = nub $ Parsed : optTargetTypes opts }))
"generate source representation"
, Option "" ["flat"] , Option "" ["flat"]
(NoArg (\opts -> opts { flat = True })) (NoArg (\opts -> opts { optTargetTypes = nub $ FlatCurry : optTargetTypes opts }))
"generate FlatCurry code" "generate FlatCurry code"
, Option "" ["extended-flat"] , Option "" ["extended-flat"]
(NoArg (\opts -> opts { extendedFlat = True })) (NoArg (\opts -> opts { optTargetTypes = nub $ ExtendedFlatCurry : optTargetTypes opts }))
"generate FlatCurry code with source references" "generate FlatCurry code with source references"
, Option "" ["xml"] , Option "" ["xml"]
(NoArg (\opts -> opts { flatXml = True })) (NoArg (\opts -> opts { optTargetTypes = nub $ FlatXml : optTargetTypes opts }))
"generate flat xml code" "generate flat xml code"
, Option "" ["acy"] , Option "" ["acy"]
(NoArg (\opts -> opts { abstract = True })) (NoArg (\opts -> opts { optTargetTypes = nub $ AbstractCurry : optTargetTypes opts }))
"generate (type infered) AbstractCurry code" "generate (type infered) AbstractCurry code"
, Option "" ["uacy"] , Option "" ["uacy"]
(NoArg (\opts -> opts { untypedAbstract = True })) (NoArg (\opts -> opts { optTargetTypes = nub $ UntypedAbstractCurry : optTargetTypes opts }))
"generate untyped AbstractCurry code" "generate untyped AbstractCurry code"
, Option "" ["parse-only"] -- extensions
(NoArg (\opts -> opts { parseOnly = True }))
"generate source representation"
, Option "e" ["extended"] , Option "e" ["extended"]
(NoArg (\opts -> opts { withExtensions = True })) (NoArg (\opts -> opts { optExtensions = nub $ BerndExtension : optExtensions opts }))
"enable extended Curry functionalities" "enable extended Curry functionalities"
, Option "X" []
(ReqArg (\arg opts -> opts { optExtensions = nub $ classifyExtension arg : optExtensions opts }) "EXT")
("enable language extension EXT")
-- dump
, Option "" ["dump-all"] , Option "" ["dump-all"]
(NoArg (\opts -> opts { dump = [minBound .. maxBound] })) (NoArg (\opts -> opts { optDumps = dumpAll }))
"dump everything" "dump everything"
, Option "" ["dump-renamed"] , Option "" ["dump-renamed"]
(NoArg (\opts -> opts { dump = nub $ DumpRenamed : dump opts })) (NoArg (\opts -> opts { optDumps = nub $ DumpRenamed : optDumps opts }))
"dump source code after renaming" "dump source code after renaming"
, Option "" ["dump-types"] , Option "" ["dump-types"]
(NoArg (\opts -> opts { dump = nub $ DumpTypes : dump opts })) (NoArg (\opts -> opts { optDumps = nub $ DumpTypes : optDumps opts }))
"dump types after type-checking" "dump types after type-checking"
, Option "" ["dump-desugared"] , Option "" ["dump-desugared"]
(NoArg (\opts -> opts { dump = nub $ DumpDesugared : dump opts })) (NoArg (\opts -> opts { optDumps = nub $ DumpDesugared : optDumps opts }))
"dump source code after desugaring" "dump source code after desugaring"
, Option "" ["dump-simplified"] , Option "" ["dump-simplified"]
(NoArg (\opts -> opts { dump = nub $ DumpSimplified : dump opts })) (NoArg (\opts -> opts { optDumps = nub $ DumpSimplified : optDumps opts }))
"dump source code after simplification" "dump source code after simplification"
, Option "" ["dump-lifted"] , Option "" ["dump-lifted"]
(NoArg (\opts -> opts { dump = nub $ DumpLifted : dump opts })) (NoArg (\opts -> opts { optDumps = nub $ DumpLifted : optDumps opts }))
"dump source code after lambda-lifting" "dump source code after lambda-lifting"
, Option "" ["dump-il"] , Option "" ["dump-il"]
(NoArg (\opts -> opts { dump = nub $ DumpIL : dump opts })) (NoArg (\opts -> opts { optDumps = nub $ DumpIL : optDumps opts }))
"dump intermediate language before lifting" "dump intermediate language before lifting"
, Option "" ["dump-case"] , Option "" ["dump-case"]
(NoArg (\opts -> opts { dump = nub $ DumpCase : dump opts })) (NoArg (\opts -> opts { optDumps = nub $ DumpCase : optDumps opts }))
"dump intermediate language after case simplification" "dump intermediate language after case simplification"
, Option "" ["no-hidden-subdir"]
(NoArg (\opts -> opts { writeToSubdir = False }))
("disable writing to hidden '" ++ currySubdir ++ "' subdirectory")
, Option "" ["x-no-implicit-prelude"]
(NoArg (\opts -> opts { xNoImplicitPrelude = True }))
("do not implicitly 'import Prelude'")
] ]
-- |Parse the command line arguments
parseOpts :: [String] -> (Options, [String], [String]) parseOpts :: [String] -> (Options, [String], [String])
parseOpts args = (foldl (flip ($)) defaultOptions opts, files, errs) where parseOpts args = (foldl (flip ($)) defaultOptions opts, files, errs) where
(opts, files, errs) = getOpt Permute options args (opts, files, errs) = getOpt Permute options args
...@@ -171,16 +203,17 @@ parseOpts args = (foldl (flip ($)) defaultOptions opts, files, errs) where ...@@ -171,16 +203,17 @@ parseOpts args = (foldl (flip ($)) defaultOptions opts, files, errs) where
-- |Check options and files and return a list of error messages -- |Check options and files and return a list of error messages
checkOpts :: Options -> [String] -> [String] checkOpts :: Options -> [String] -> [String]
checkOpts opts files checkOpts opts files
| isJust (output opts) && length files > 1 | isJust (optOutput opts) && length files > 1
= ["cannot specify -o with multiple targets"] = ["cannot specify -o with multiple targets"]
| otherwise | otherwise
= [] = []
-- |Print the usage information of the command line tool. -- |Print the usage information of the command line tool.
usage :: String -> String usage :: String -> String
usage prog = usageInfo header options usage prog = usageInfo header options
where header = "usage: " ++ prog ++ " [OPTION] ... MODULE ..." where header = "usage: " ++ prog ++ " [OPTION] ... MODULE ..."
-- |Retrieve the compiler 'Options'
compilerOpts :: IO (String, Options, [String], [String]) compilerOpts :: IO (String, Options, [String], [String])
compilerOpts = do compilerOpts = do
args <- getArgs args <- getArgs
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
September 2005, Martin Engelke (men@informatik.uni-kiel.de) September 2005, Martin Engelke (men@informatik.uni-kiel.de)
March 2007, extensions by Sebastian Fischer (sebf@informatik.uni-kiel.de) March 2007, extensions by Sebastian Fischer (sebf@informatik.uni-kiel.de)
May 2011, refinements b Bjoern Peemoeller (bjp@informatik.uni-kiel.de)
-} -}
module CurryBuilder (buildCurry, smake) where module CurryBuilder (buildCurry, smake) where
...@@ -15,7 +16,7 @@ import Curry.Files.Filenames ...@@ -15,7 +16,7 @@ import Curry.Files.Filenames
import Curry.Files.PathUtils ( dropExtension, doesModuleExist, getCurryPath import Curry.Files.PathUtils ( dropExtension, doesModuleExist, getCurryPath
, getModuleModTime, tryGetModuleModTime) , getModuleModTime, tryGetModuleModTime)
import CurryCompilerOpts (Options (..)) import CompilerOpts (Options (..), Extension (..), TargetType (..))
import CurryDeps (Source (..), flatDeps) import CurryDeps (Source (..), flatDeps)
import Messages (status, abortWith) import Messages (status, abortWith)
import Modules (compileModule) import Modules (compileModule)
...@@ -32,11 +33,14 @@ buildCurry opts file = do ...@@ -32,11 +33,14 @@ buildCurry opts file = do
Just f -> do Just f -> do
(deps, errs) <- flatDeps implicitPrelude paths [] f (deps, errs) <- flatDeps implicitPrelude paths [] f
unless (null errs) (abortWith errs) unless (null errs) (abortWith errs)
makeCurry opts deps f makeCurry (defaultToFlatCurry opts) deps f
where where
paths = importPaths opts paths = optImportPaths opts
implicitPrelude = not $ xNoImplicitPrelude opts implicitPrelude = NoImplicitPrelude `notElem` optExtensions opts
missingModule f = "Error: missing module \"" ++ f ++ "\"" missingModule f = "Error: missing module \"" ++ f ++ "\""
defaultToFlatCurry opt
| null $ optTargetTypes opt = opt { optTargetTypes = [FlatCurry] }
| otherwise = opt
makeCurry :: Options -> [(ModuleIdent, Source)] -> FilePath -> IO () makeCurry :: Options -> [(ModuleIdent, Source)] -> FilePath -> IO ()
makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where
...@@ -47,7 +51,7 @@ makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where ...@@ -47,7 +51,7 @@ makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where
-- target file -- target file
| dropExtension targetFile == dropExtension file = do | dropExtension targetFile == dropExtension file = do
flatIntfExists <- doesModuleExist (flatIntName file) flatIntfExists <- doesModuleExist (flatIntName file)
if flatIntfExists && not (force opts) && null (dump opts) if flatIntfExists && not (optForce opts) && null (optDumps opts)
then smake (targetNames file) then smake (targetNames file)
(targetFile: (catMaybes (map flatInterface mods))) (targetFile: (catMaybes (map flatInterface mods)))
(generateFile file) (generateFile file)
...@@ -73,11 +77,12 @@ makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where ...@@ -73,11 +77,12 @@ makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where
compileModule (compOpts False) f >> return () compileModule (compOpts False) f >> return ()
targetNames fn targetNames fn
| flat opts = [flatName' opts fn] -- , flatIntName fn] | FlatCurry `elem` optTargetTypes opts = [flatName' opts fn] -- , flatIntName fn]
| flatXml opts = [xmlName fn] | FlatXml `elem` optTargetTypes opts = [xmlName fn]
| abstract opts = [acyName fn] | AbstractCurry `elem` optTargetTypes opts = [acyName fn]
| untypedAbstract opts = [uacyName fn] | UntypedAbstractCurry `elem` optTargetTypes opts = [uacyName fn]
| parseOnly opts = [fromMaybe (sourceRepName fn) (output opts)] | Parsed `elem` optTargetTypes opts
= [fromMaybe (sourceRepName fn) (optOutput opts)]
| otherwise = [flatName' opts fn] -- , flatIntName fn] | otherwise = [flatName' opts fn] -- , flatIntName fn]
flatInterface mod1 = case (lookup mod1 deps1) of flatInterface mod1 = case (lookup mod1 deps1) of
...@@ -86,18 +91,13 @@ makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where ...@@ -86,18 +91,13 @@ makeCurry opts deps1 targetFile = mapM_ (compile . snd) deps1 where
_ -> Nothing _ -> Nothing
compOpts isImport compOpts isImport
| isImport = opts | isImport = opts { optTargetTypes = [FlatCurry], optDumps = [] }
{ flat = True
, flatXml = False
, abstract = False
, untypedAbstract = False
, parseOnly = False
, dump = []
}
| otherwise = opts | otherwise = opts
flatName' :: Options -> FilePath -> FilePath flatName' :: Options -> FilePath -> FilePath
flatName' opts = if extendedFlat opts then extFlatName else flatName flatName' opts
| ExtendedFlatCurry `elem` optTargetTypes opts = extFlatName
| otherwise = flatName
{- |A simple make function {- |A simple make function
...@@ -118,30 +118,18 @@ smake dests deps cmd alt = do ...@@ -118,30 +118,18 @@ smake dests deps cmd alt = do
| outOfDate destTimes depTimes = cmd | outOfDate destTimes depTimes = cmd
| otherwise = alt | otherwise = alt
abortOnError :: IO a -> IO a
abortOnError act = catch act (\err -> abortWith [show err])
-- --
getDestTimes :: [FilePath] -> IO [ClockTime] getDestTimes :: [FilePath] -> IO [ClockTime]
getDestTimes = liftM catMaybes . mapM tryGetModuleModTime getDestTimes = liftM catMaybes . mapM tryGetModuleModTime
-- getDestTimes [] = return []
-- getDestTimes (file:files) = catch
-- (do time <- getModuleModTime file
-- times <- getDestTimes files
-- return (time:times))
-- (const (getDestTimes files))
-- --
getDepTimes :: [String] -> IO [ClockTime] getDepTimes :: [String] -> IO [ClockTime]
getDepTimes = mapM (abortOnError . getModuleModTime) getDepTimes = mapM (abortOnError . getModuleModTime)
-- getDepTimes [] = return []
-- getDepTimes (file:files) = catch
-- (do time <- getModuleModTime file
-- times <- getDepTimes files
-- return (time:times))
-- (\err -> abortWith [show err])
-- --
outOfDate :: [ClockTime] -> [ClockTime] -> Bool outOfDate :: [ClockTime] -> [ClockTime] -> Bool
outOfDate tgtimes dptimes = or [ tg < dp | tg <- tgtimes, dp <- dptimes] outOfDate tgtimes dptimes = or [ tg < dp | tg <- tgtimes, dp <- dptimes]
-- outOfDate tgtimes dptimes = or (map (\t -> or (map ((<) t) dptimes)) tgtimes)
abortOnError :: IO a -> IO a
abortOnError act = catch act (\err -> abortWith [show err])
...@@ -16,10 +16,10 @@ import Curry.Files.Filenames ...@@ -16,10 +16,10 @@ import Curry.Files.Filenames
import Curry.Files.PathUtils import Curry.Files.PathUtils
import qualified Curry.Syntax as CS (Module (..), Decl (..), parseModule) import qualified Curry.Syntax as CS (Module (..), Decl (..), parseModule)
import CompilerOpts (Options (..), Verbosity (..), TargetType (..), defaultOptions)
import Modules (checkModule, simpleCheckModule, compileModule, importPrelude import Modules (checkModule, simpleCheckModule, compileModule, importPrelude
, patchModuleId, loadInterfaces) , patchModuleId, loadInterfaces)
import CurryBuilder (smake) import CurryBuilder (smake)
import CurryCompilerOpts (Options (..), defaultOptions)
import CurryDeps (flattenDeps, moduleDeps, Source (..)) import CurryDeps (flattenDeps, moduleDeps, Source (..))
import Base.Module (ModuleEnv) import Base.Module (ModuleEnv)
...@@ -102,8 +102,8 @@ makeInterfaces paths (CS.Module mid _ decls) = do ...@@ -102,8 +102,8 @@ makeInterfaces paths (CS.Module mid _ decls) = do
opts :: [FilePath] -> Options opts :: [FilePath] -> Options
opts paths = defaultOptions opts paths = defaultOptions
{ importPaths = paths { optImportPaths = paths
, noVerb = True , optVerbosity = Quiet
, noWarn = True , optWarn = False
, abstract = True , optTargetTypes = [AbstractCurry]
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
module Gen.GenFlatCurry (genFlatCurry, genFlatInterface) where module Gen.GenFlatCurry (genFlatCurry, genFlatInterface) where
-- Haskell libraries -- Haskell libraries
import Control.Monad (filterM, liftM, mplus, unless) import Control.Monad (filterM, liftM, mplus, when)
import Control.Monad.State (State, runState, gets, modify) import Control.Monad.State (State, runState, gets, modify)
import Data.List (nub) import Data.List (nub)
import qualified Data.Map as Map (Map, empty, insert, lookup, fromList, toList) import qualified Data.Map as Map (Map, empty, insert, lookup, fromList, toList)
...@@ -29,7 +29,7 @@ import Base.Module (ModuleEnv) ...@@ -29,7 +29,7 @@ import Base.Module (ModuleEnv)
import Base.TypeConstructors (TCEnv, TypeInfo (..), qualLookupTC) import Base.TypeConstructors (TCEnv, TypeInfo (..), qualLookupTC)
import Base.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue) import Base.Value (ValueEnv, ValueInfo (..), lookupValue, qualLookupValue)
import CurryCompilerOpts (Options (..)) import CompilerOpts (Options (..))
import qualified CurryToIL as IL import qualified CurryToIL as IL
import Env.TopEnv (topEnvMap) import Env.TopEnv (topEnvMap)
import Env.CurryEnv (CurryEnv) import Env.CurryEnv (CurryEnv)
...@@ -804,18 +804,17 @@ flattenRecordTypeFields ...@@ -804,18 +804,17 @@ flattenRecordTypeFields
-- --
checkOverlapping :: Expr -> Expr -> FlatState () checkOverlapping :: Expr -> Expr -> FlatState ()
checkOverlapping expr1 expr2