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

Refinements of Base modules

parent 9f4fa140
{- |Arity - provides functions for expanding the arity environment 'ArityEnv'
(see Module "Base")
In order to generate correct FlatCurry applications it is necessary
to define the number of arguments as the arity value (instead of
using the arity computed from the type). For this reason the compiler
needs a table containing the information for all known functions
and constructors.
September 2005, Martin Engelke (men@informatik.uni-kiel.de)
-}
......@@ -15,13 +20,6 @@ import Env.TopEnv
import Utils ((++!))
import Types (Data (..), predefTypes)
{-
In order to generate correct FlatCurry application it is necessary
to define the number of arguments as the arity value (instead of
using the arity computed from the type). For this reason the compiler
needs a table containing the information for all known functions
and constructors.
-}
type ArityEnv = TopEnv ArityInfo
data ArityInfo = ArityInfo QualIdent Int deriving Show
......@@ -55,7 +53,7 @@ qualLookupArity qid aEnv = qualLookupTopEnv qid aEnv
qualLookupConsArity :: QualIdent -> ArityEnv -> [ArityInfo]
qualLookupConsArity qid aEnv
| maybe False ((==) preludeMIdent) mmid && ident == consId
| maybe False (== preludeMIdent) mmid && ident == consId
= qualLookupTopEnv (qualify ident) aEnv
| otherwise
= []
......@@ -100,54 +98,54 @@ visitLhs _ _ aEnv _ = aEnv
visitRhs :: ModuleIdent -> ArityEnv -> Rhs -> ArityEnv
visitRhs mid aEnv (SimpleRhs _ expr decls)
= foldl (visitDecl mid) (visitExpression mid aEnv expr) decls
= foldl (visitDecl mid) (visitExpr mid aEnv expr) decls
visitRhs mid aEnv (GuardedRhs cexprs decls)
= foldl (visitDecl mid) (foldl (visitCondExpr mid) aEnv cexprs) decls
visitCondExpr :: ModuleIdent -> ArityEnv -> CondExpr -> ArityEnv
visitCondExpr mid aEnv (CondExpr _ cond expr)
= visitExpression mid (visitExpression mid aEnv expr) cond
visitExpression :: ModuleIdent -> ArityEnv -> Expression -> ArityEnv
visitExpression mid aEnv (Paren expr)
= visitExpression mid aEnv expr
visitExpression mid aEnv (Typed expr _)
= visitExpression mid aEnv expr
visitExpression mid aEnv (Tuple _ exprs)
= foldl (visitExpression mid) aEnv exprs
visitExpression mid aEnv (List _ exprs)
= foldl (visitExpression mid) aEnv exprs
visitExpression mid aEnv (ListCompr _ expr stmts)
= foldl (visitStatement mid) (visitExpression mid aEnv expr) stmts
visitExpression mid aEnv (EnumFrom expr)
= visitExpression mid aEnv expr
visitExpression mid aEnv (EnumFromThen expr1 expr2)
= foldl (visitExpression mid) aEnv [expr1,expr2]
visitExpression mid aEnv (EnumFromTo expr1 expr2)
= foldl (visitExpression mid) aEnv [expr1,expr2]
visitExpression mid aEnv (EnumFromThenTo expr1 expr2 expr3)
= foldl (visitExpression mid) aEnv [expr1,expr2,expr3]
visitExpression mid aEnv (UnaryMinus _ expr)
= visitExpression mid aEnv expr
visitExpression mid aEnv (Apply expr1 expr2)
= foldl (visitExpression mid) aEnv [expr1,expr2]
visitExpression mid aEnv (InfixApply expr1 _ expr2)
= foldl (visitExpression mid) aEnv [expr1,expr2]
visitExpression mid aEnv (LeftSection expr _)
= visitExpression mid aEnv expr
visitExpression mid aEnv (RightSection _ expr)
= visitExpression mid aEnv expr
visitExpression mid aEnv (Lambda _ _ expr)
= visitExpression mid aEnv expr
visitExpression mid aEnv (Let decls expr)
= foldl (visitDecl mid) (visitExpression mid aEnv expr) decls
visitExpression mid aEnv (Do stmts expr)
= foldl (visitStatement mid) (visitExpression mid aEnv expr) stmts
visitExpression mid aEnv (IfThenElse _ expr1 expr2 expr3)
= foldl (visitExpression mid) aEnv [expr1,expr2,expr3]
visitExpression mid aEnv (Case _ expr alts)
= visitExpression mid (foldl (visitAlt mid) aEnv alts) expr
visitExpression _ aEnv _ = aEnv
= visitExpr mid (visitExpr mid aEnv expr) cond
visitExpr :: ModuleIdent -> ArityEnv -> Expression -> ArityEnv
visitExpr mid aEnv (Paren expr)
= visitExpr mid aEnv expr
visitExpr mid aEnv (Typed expr _)
= visitExpr mid aEnv expr
visitExpr mid aEnv (Tuple _ exprs)
= foldl (visitExpr mid) aEnv exprs
visitExpr mid aEnv (List _ exprs)
= foldl (visitExpr mid) aEnv exprs
visitExpr mid aEnv (ListCompr _ expr stmts)
= foldl (visitStatement mid) (visitExpr mid aEnv expr) stmts
visitExpr mid aEnv (EnumFrom expr)
= visitExpr mid aEnv expr
visitExpr mid aEnv (EnumFromThen expr1 expr2)
= foldl (visitExpr mid) aEnv [expr1, expr2]
visitExpr mid aEnv (EnumFromTo expr1 expr2)
= foldl (visitExpr mid) aEnv [expr1, expr2]
visitExpr mid aEnv (EnumFromThenTo expr1 expr2 expr3)
= foldl (visitExpr mid) aEnv [expr1, expr2, expr3]
visitExpr mid aEnv (UnaryMinus _ expr)
= visitExpr mid aEnv expr
visitExpr mid aEnv (Apply expr1 expr2)
= foldl (visitExpr mid) aEnv [expr1, expr2]
visitExpr mid aEnv (InfixApply expr1 _ expr2)
= foldl (visitExpr mid) aEnv [expr1, expr2]
visitExpr mid aEnv (LeftSection expr _)
= visitExpr mid aEnv expr
visitExpr mid aEnv (RightSection _ expr)
= visitExpr mid aEnv expr
visitExpr mid aEnv (Lambda _ _ expr)
= visitExpr mid aEnv expr
visitExpr mid aEnv (Let decls expr)
= foldl (visitDecl mid) (visitExpr mid aEnv expr) decls
visitExpr mid aEnv (Do stmts expr)
= foldl (visitStatement mid) (visitExpr mid aEnv expr) stmts
visitExpr mid aEnv (IfThenElse _ expr1 expr2 expr3)
= foldl (visitExpr mid) aEnv [expr1, expr2, expr3]
visitExpr mid aEnv (Case _ expr alts)
= visitExpr mid (foldl (visitAlt mid) aEnv alts) expr
visitExpr _ aEnv _ = aEnv
visitStatement :: ModuleIdent -> ArityEnv -> Statement -> ArityEnv
visitStatement mid aEnv (StmtExpr _ expr)
......
% $Id: Eval.lhs,v 1.12 2004/02/08 15:35:12 wlux Exp $
%
% Copyright (c) 2001-2004, Wolfgang Lux
......@@ -29,13 +28,13 @@ the module by traversing the syntax tree.
> evalEnv = foldr collectAnnotsDecl Map.empty
> collectAnnotsDecl :: Decl -> EvalEnv -> EvalEnv
> collectAnnotsDecl (EvalAnnot _ fs ev) env = foldr (flip Map.insert ev) env fs
> collectAnnotsDecl (EvalAnnot _ fs ev ) env = foldr (`Map.insert` ev) env fs
> collectAnnotsDecl (FunctionDecl _ _ eqs) env = foldr collectAnnotsEqn env eqs
> collectAnnotsDecl (PatternDecl _ _ rhs) env = collectAnnotsRhs rhs env
> collectAnnotsDecl (PatternDecl _ _ rhs ) env = collectAnnotsRhs rhs env
> collectAnnotsDecl _ env = env
> collectAnnotsEqn :: Equation -> EvalEnv -> EvalEnv
> collectAnnotsEqn (Equation _ _ rhs) env = collectAnnotsRhs rhs env
> collectAnnotsEqn (Equation _ _ rhs) = collectAnnotsRhs rhs
> collectAnnotsRhs :: Rhs -> EvalEnv -> EvalEnv
> collectAnnotsRhs (SimpleRhs _ e ds) env =
......@@ -81,17 +80,17 @@ the module by traversing the syntax tree.
> collectAnnotsExpr (Case _ e alts) env =
> collectAnnotsExpr e (foldr collectAnnotsAlt env alts)
> collectAnnotsExpr (RecordConstr fs) env =
> foldr collectAnnotsExpr env (map fieldTerm fs)
> foldr (collectAnnotsExpr . fieldTerm) env fs
> collectAnnotsExpr (RecordSelection e _) env = collectAnnotsExpr e env
> collectAnnotsExpr (RecordUpdate fs e) env =
> foldr collectAnnotsExpr (collectAnnotsExpr e env) (map fieldTerm fs)
> foldr (collectAnnotsExpr . fieldTerm) (collectAnnotsExpr e env) fs
> collectAnnotsStmt :: Statement -> EvalEnv -> EvalEnv
> collectAnnotsStmt (StmtExpr _ e) env = collectAnnotsExpr e env
> collectAnnotsStmt (StmtDecl ds) env = foldr collectAnnotsDecl env ds
> collectAnnotsStmt (StmtExpr _ e ) env = collectAnnotsExpr e env
> collectAnnotsStmt (StmtDecl ds ) env = foldr collectAnnotsDecl env ds
> collectAnnotsStmt (StmtBind _ _ e) env = collectAnnotsExpr e env
> collectAnnotsAlt :: Alt -> EvalEnv -> EvalEnv
> collectAnnotsAlt (Alt _ _ rhs) env = collectAnnotsRhs rhs env
> collectAnnotsAlt (Alt _ _ rhs) = collectAnnotsRhs rhs
\end{verbatim}
\paragraph{Module aliases}
\begin{verbatim}
-- |Module aliases
> module Base.Import
> ( ImportEnv, bindAlias, lookupAlias, sureLookupAlias, initIEnv
> , fromDeclList
> ) where
module Base.Import
( ImportEnv, bindAlias, lookupAlias, sureLookupAlias, initIEnv, fromDeclList
) where
> import qualified Data.Map as Map (Map, empty, insert, lookup)
> import Data.Maybe (fromMaybe)
import qualified Data.Map as Map (Map, empty, insert, lookup)
import Data.Maybe (fromMaybe)
> import Curry.Base.Ident (ModuleIdent)
> import qualified Curry.Syntax as CS (Decl (..))
import Curry.Base.Ident (ModuleIdent)
import qualified Curry.Syntax as CS (Decl (..))
> type ImportEnv = Map.Map ModuleIdent ModuleIdent
type ImportEnv = Map.Map ModuleIdent ModuleIdent
> bindAlias :: CS.Decl -> ImportEnv -> ImportEnv
> bindAlias (CS.ImportDecl _ mid _ alias _)
> = Map.insert mid $ fromMaybe mid alias
> bindAlias _ = error "Base.bindAlias: no import declaration"
bindAlias :: CS.Decl -> ImportEnv -> ImportEnv
bindAlias (CS.ImportDecl _ mid _ alias _)
= Map.insert mid $ fromMaybe mid alias
bindAlias _ = error "Base.bindAlias: no import declaration"
> fromDeclList :: [CS.Decl] -> ImportEnv
> fromDeclList = foldr bindAlias initIEnv
fromDeclList :: [CS.Decl] -> ImportEnv
fromDeclList = foldr bindAlias initIEnv
> lookupAlias :: ModuleIdent -> ImportEnv -> Maybe ModuleIdent
> lookupAlias = Map.lookup
lookupAlias :: ModuleIdent -> ImportEnv -> Maybe ModuleIdent
lookupAlias = Map.lookup
> sureLookupAlias :: ModuleIdent -> ImportEnv -> ModuleIdent
> sureLookupAlias m = fromMaybe m . lookupAlias m
sureLookupAlias :: ModuleIdent -> ImportEnv -> ModuleIdent
sureLookupAlias m = fromMaybe m . lookupAlias m
> initIEnv :: ImportEnv
> initIEnv = Map.empty
\end{verbatim}
initIEnv :: ImportEnv
initIEnv = Map.empty
......@@ -13,8 +13,8 @@ for PAKCS.
> import qualified Data.Map as Map
> import Curry.Base.Ident
> import qualified Curry.Syntax as CS
> import Curry.Base.Ident (ModuleIdent)
> import qualified Curry.Syntax as CS (IDecl)
> type ModuleEnv = Map.Map ModuleIdent [CS.IDecl]
......
......@@ -39,7 +39,7 @@ precedences are simpler than for the type and value environments
because they do not need to handle tuple constructors.
\begin{verbatim}
> data PrecInfo = PrecInfo QualIdent OpPrec deriving (Eq,Show)
> data PrecInfo = PrecInfo QualIdent OpPrec deriving (Eq, Show)
> instance Entity PrecInfo where
> origName (PrecInfo op _) = op
......
......@@ -51,9 +51,9 @@ changes which are private to the module.
> origName (AliasType tc _ _) = tc
> merge (DataType tc n cs) (DataType tc' _ cs')
> | tc == tc' = Just (DataType tc n (mergeData cs cs'))
> where mergeData ds [] = ds
> mergeData [] ds = ds
> mergeData (d:ds) (d':ds') = d `mplus` d' : mergeData ds ds'
> where mergeData ds [] = ds
> mergeData [] ds = ds
> mergeData (d : ds) (d' : ds') = d `mplus` d' : mergeData ds ds'
> merge (DataType tc n _) (RenamingType tc' _ nc)
> | tc == tc' = Just (RenamingType tc n nc)
> merge (RenamingType tc n nc) (DataType tc' _ _)
......@@ -115,4 +115,4 @@ impossible to insert them into the environment in advance.
> DataType tc (length tys) . map Just
> predefTC _ = error "Base.initTCEnv.predefTC: no type constructor"
\end{verbatim}
\ No newline at end of file
\end{verbatim}
......@@ -33,11 +33,11 @@ order of type variables in the left hand side of a type declaration.
> toQualTypes m tvs = map (qualifyType m) . toTypes tvs
> toType :: [Ident] -> CS.TypeExpr -> Type
> toType tvs ty = toType' (Map.fromList (zip (tvs ++ tvs') [0..])) ty
> toType tvs ty = toType' (Map.fromList (zip (tvs ++ tvs') [0 ..])) ty
> where tvs' = [tv | tv <- nub (fv ty), tv `notElem` tvs]
> toTypes :: [Ident] -> [CS.TypeExpr] -> [Type]
> toTypes tvs tys = map (toType' (Map.fromList (zip (tvs ++ tvs') [0..]))) tys
> toTypes tvs tys = map (toType' (Map.fromList (zip (tvs ++ tvs') [0 ..]))) tys
> where tvs' = [tv | tv <- nub (concatMap fv tys), tv `notElem` tvs]
> toType' :: Map.Map Ident Int -> CS.TypeExpr -> Type
......@@ -53,9 +53,9 @@ order of type variables in the left hand side of a type declaration.
> toType' tvs (CS.ArrowType ty1 ty2) =
> TypeArrow (toType' tvs ty1) (toType' tvs ty2)
> toType' tvs (CS.RecordType fs rty) =
> TypeRecord (concatMap (\ (ls,ty) -> map (\l -> (l, toType' tvs ty)) ls) fs)
> TypeRecord (concatMap (\ (ls, ty) -> map (\ l -> (l, toType' tvs ty)) ls) fs)
> (maybe Nothing
> (\ty -> case toType' tvs ty of
> (\ ty -> case toType' tvs ty of
> TypeVariable tv -> Just tv
> _ -> internalError ("toType " ++ show ty))
> rty)
......@@ -78,5 +78,5 @@ order of type variables in the left hand side of a type declaration.
> fromType (TypeArrow ty1 ty2) = CS.ArrowType (fromType ty1) (fromType ty2)
> fromType (TypeSkolem k) = CS.VariableType (mkIdent ("_?" ++ show k))
> fromType (TypeRecord fs rty) =
> CS.RecordType (map (\ (l,ty) -> ([l], fromType ty)) fs)
> (maybe Nothing (Just . fromType . TypeVariable) rty)
\ No newline at end of file
> CS.RecordType (map (\ (l, ty) -> ([l], fromType ty)) fs)
> (maybe Nothing (Just . fromType . TypeVariable) rty)
......@@ -93,7 +93,7 @@ allow the usage of the qualified list constructor \texttt{(Prelude.:)}.
> qualLookupCons :: QualIdent -> ValueEnv -> [ValueInfo]
> qualLookupCons x tyEnv
> | maybe False ((==) preludeMIdent) mmid && qid == consId
> | maybe False (preludeMIdent ==) mmid && qid == consId
> = qualLookupTopEnv (qualify qid) tyEnv
> | otherwise = []
> where (mmid, qid) = (qualidMod x, qualidId x)
......@@ -116,8 +116,8 @@ TODO: Match other patterns?
> initDCEnv :: ValueEnv
> initDCEnv =
> foldr (uncurry predefDC) emptyTopEnv
> [(c,constrType (polyType ty) n' tys)
> | (ty,cs) <- predefTypes, Data c n' tys <- cs]
> [ (c, constrType (polyType ty) n' tys)
> | (ty, cs) <- predefTypes, Data c n' tys <- cs]
> where predefDC c ty = predefTopEnv c' (DataConstructor c' ty)
> where c' = qualify c
> constrType (ForAll n ty) n' = ForAllExist n n' . foldr TypeArrow ty
......
......@@ -2,12 +2,13 @@
compiling Curry programs (see module "CurryCompiler")
September 2005, Martin Engelke (men@informatik.uni-kiel.de)
March 2007 , extensions by Sebastian Fischer (sebf@informatik.uni-kiel.de)
May 2011 , refinements by Bjoern Peemoeller (bjp@informatik.uni-kiel.de)
March 2007, extensions by Sebastian Fischer (sebf@informatik.uni-kiel.de)
May 2011, refinements by Bjoern Peemoeller (bjp@informatik.uni-kiel.de)
-}
module CompilerOpts
( Options (..), Verbosity (..), TargetType (..), Extension (..)
, DumpLevel (..), defaultOptions, compilerOpts, usage
, implicitPrelude
) where
import Data.List (nub)
......@@ -56,6 +57,7 @@ defaultOptions = Options
, optDumps = []
}
-- |Data type representing the type of the target file
data TargetType
= Parsed
| FlatCurry
......@@ -65,11 +67,13 @@ data TargetType
| UntypedAbstractCurry
deriving Eq
-- |Data type representing the verbosity level
data Verbosity
= Quiet
| Verbose
deriving Eq
-- |Classifies a number as a 'Verbosity'
classifyVerbosity :: String -> Verbosity
classifyVerbosity "0" = Quiet
classifyVerbosity _ = Verbose
......@@ -88,19 +92,23 @@ data DumpLevel
| DumpCase -- ^ dump IL code after case elimination
deriving (Eq, Bounded, Enum, Show)
-- |All available 'DumpLevel's
dumpAll :: [DumpLevel]
dumpAll = [minBound .. maxBound]
-- |Data type representing language extensions
data Extension
= BerndExtension -- TODO: Give it a more concise name
| NoImplicitPrelude
| Records
| FunctionPatterns
| AnonymousFreeVariables
| NoImplicitPrelude
| UnknownExtension String
deriving (Eq, Read, Show)
-- |Classifies a 'String' as an 'Extension'
classifyExtension :: String -> Extension
classifyExtension str = case readsPrec 0 str of
classifyExtension str = case reads str of
[(e, "")] -> e
_ -> UnknownExtension str
......@@ -109,89 +117,102 @@ options :: [OptDescr (Options -> Options)]
options =
-- general
[ Option "h?" ["help"]
(NoArg (\opts -> opts { optHelp = True }))
(NoArg (\ opts -> opts { optHelp = True }))
"display this help and exit"
, Option "V" ["version"]
(NoArg (\opts -> opts { optVersion = True }))
(NoArg (\ opts -> opts { optVersion = True }))
"show the version number"
, Option "" ["html"]
(NoArg (\opts -> opts { optHtml = True }))
(NoArg (\ opts -> opts { optHtml = True }))
"generate html code"
, Option "v" ["verbosity"]
(ReqArg (\arg opts -> opts { optVerbosity = classifyVerbosity arg }) "<n>")
(ReqArg (\ arg opts -> opts { optVerbosity =
classifyVerbosity arg }) "<n>")
"set verbosity level to <n>"
-- compilation
, Option "f" ["force"]
(NoArg (\opts -> opts { optForce = True }))
(NoArg (\ opts -> opts { optForce = True }))
"force compilation of dependent files"
, Option "i" ["import-dir"]
(ReqArg (\arg opts -> opts { optImportPaths = nub $ arg : optImportPaths opts }) "DIR")
(ReqArg (\ arg opts -> opts { optImportPaths =
nub $ arg : optImportPaths opts }) "DIR")
"search for imports in DIR"
, Option "o" ["output"]
(ReqArg (\arg opts -> opts { optOutput = Just arg }) "FILE")
(ReqArg (\ arg opts -> opts { optOutput = Just arg }) "FILE")
"write code to FILE"
, Option "" ["no-subdir"]
(NoArg (\opts -> opts { optUseSubdir = False }))
(NoArg (\ opts -> opts { optUseSubdir = False }))
("disable writing to '" ++ currySubdir ++ "' subdirectory")
, Option "" ["no-intf"]
(NoArg (\opts -> opts { optInterface = False }))
(NoArg (\ opts -> opts { optInterface = False }))
"do not create an interface file"
, Option "" ["no-warn"]
(NoArg (\opts -> opts { optWarn = False }))
(NoArg (\ opts -> opts { optWarn = False }))
"do not print warnings"
, Option "" ["no-overlap-warn"]
(NoArg (\opts -> opts { optOverlapWarn = False }))
(NoArg (\ opts -> opts { optOverlapWarn = False }))
"do not print warnings for overlapping rules"
-- target types
, Option "" ["parse-only"]
(NoArg (\opts -> opts { optTargetTypes = nub $ Parsed : optTargetTypes opts }))
(NoArg (\ opts -> opts { optTargetTypes =
nub $ Parsed : optTargetTypes opts }))
"generate source representation"
, Option "" ["flat"]
(NoArg (\opts -> opts { optTargetTypes = nub $ FlatCurry : optTargetTypes opts }))
(NoArg (\ opts -> opts { optTargetTypes =
nub $ FlatCurry : optTargetTypes opts }))
"generate FlatCurry code"
, Option "" ["extended-flat"]
(NoArg (\opts -> opts { optTargetTypes = nub $ ExtendedFlatCurry : optTargetTypes opts }))
(NoArg (\ opts -> opts { optTargetTypes =
nub $ ExtendedFlatCurry : optTargetTypes opts }))
"generate FlatCurry code with source references"
, Option "" ["xml"]
(NoArg (\opts -> opts { optTargetTypes = nub $ FlatXml : optTargetTypes opts }))
(NoArg (\ opts -> opts { optTargetTypes =
nub $ FlatXml : optTargetTypes opts }))
"generate flat xml code"
, Option "" ["acy"]
(NoArg (\opts -> opts { optTargetTypes = nub $ AbstractCurry : optTargetTypes opts }))
(NoArg (\ opts -> opts { optTargetTypes =
nub $ AbstractCurry : optTargetTypes opts }))
"generate (type infered) AbstractCurry code"
, Option "" ["uacy"]
(NoArg (\opts -> opts { optTargetTypes = nub $ UntypedAbstractCurry : optTargetTypes opts }))
(NoArg (\ opts -> opts { optTargetTypes =
nub $ UntypedAbstractCurry : optTargetTypes opts }))
"generate untyped AbstractCurry code"
-- extensions
, Option "e" ["extended"]
(NoArg (\opts -> opts { optExtensions = nub $ BerndExtension : optExtensions opts }))
(NoArg (\ opts -> opts { optExtensions =
nub $ BerndExtension : optExtensions opts }))
"enable extended Curry functionalities"
, Option "X" []
(ReqArg (\arg opts -> opts { optExtensions = nub $ classifyExtension arg : optExtensions opts }) "EXT")
("enable language extension EXT")
(ReqArg (\ arg opts -> opts { optExtensions =
nub $ classifyExtension arg : optExtensions opts }) "EXT")
"enable language extension EXT"
-- dump
, Option "" ["dump-all"]
(NoArg (\opts -> opts { optDumps = dumpAll }))
(NoArg (\ opts -> opts { optDumps = dumpAll }))
"dump everything"
, Option "" ["dump-renamed"]
(NoArg (\opts -> opts { optDumps = nub $ DumpRenamed : optDumps opts }))
(NoArg (\ opts -> opts { optDumps =
nub $ DumpRenamed : optDumps opts }))
"dump source code after renaming"
, Option "" ["dump-types"]
(NoArg (\opts -> opts { optDumps = nub $ DumpTypes : optDumps opts }))
(NoArg (\ opts -> opts { optDumps = nub $ DumpTypes : optDumps opts }))
"dump types after type-checking"
, Option "" ["dump-desugared"]
(NoArg (\opts -> opts { optDumps = nub $ DumpDesugared : optDumps opts }))
(NoArg (\ opts -> opts { optDumps =
nub $ DumpDesugared : optDumps opts }))
"dump source code after desugaring"
, Option "" ["dump-simplified"]
(NoArg (\opts -> opts { optDumps = nub $ DumpSimplified : optDumps opts }))
(NoArg (\ opts -> opts { optDumps = nub $
DumpSimplified : optDumps opts }))
"dump source code after simplification"
, Option "" ["dump-lifted"]
(NoArg (\opts -> opts { optDumps = nub $ DumpLifted : optDumps opts }))
(NoArg (\ opts -> opts { optDumps = nub $ DumpLifted : optDumps opts }))
"dump source code after lambda-lifting"
, Option "" ["dump-il"]
(NoArg (\opts -> opts { optDumps = nub $ DumpIL : optDumps opts }))
(NoArg (\ opts -> opts { optDumps = nub $ DumpIL : optDumps opts }))
"dump intermediate language before lifting"
, Option "" ["dump-case"]
(NoArg (\opts -> opts { optDumps = nub $ DumpCase : optDumps opts }))
(NoArg (\ opts -> opts { optDumps = nub $ DumpCase : optDumps opts }))
"dump intermediate language after case simplification"
]
......
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