From dead48b49a68659a3bd7f5327a7001336ca0cc1e Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 8 Dec 2000 09:45:42 +0000 Subject: [PATCH] [project @ 2000-12-08 09:45:41 by simonpj] Add -fno-monomorphism-restriction --- ghc/compiler/main/CmdLineOpts.lhs | 2 ++ ghc/compiler/typecheck/TcBinds.lhs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/main/CmdLineOpts.lhs b/ghc/compiler/main/CmdLineOpts.lhs index 335e8a9..cf5fdeb 100644 --- a/ghc/compiler/main/CmdLineOpts.lhs +++ b/ghc/compiler/main/CmdLineOpts.lhs @@ -51,6 +51,7 @@ module CmdLineOpts ( opt_NumbersStrict, opt_Parallel, opt_SMP, + opt_NoMonomorphismRestriction, -- optimisation opts opt_DoSemiTagging, @@ -405,6 +406,7 @@ opt_DoTickyProfiling = lookUp SLIT("-fticky-ticky") -- language opts opt_AllStrict = lookUp SLIT("-fall-strict") +opt_NoMonomorphismRestriction = lookUp SLIT("-fno-monomorphism-restriction") opt_DictsStrict = lookUp SLIT("-fdicts-strict") opt_IrrefutableTuples = lookUp SLIT("-firrefutable-tuples") opt_MaxContextReductionDepth = lookup_def_int "-fcontext-stack" mAX_CONTEXT_REDUCTION_DEPTH diff --git a/ghc/compiler/typecheck/TcBinds.lhs b/ghc/compiler/typecheck/TcBinds.lhs index 9c2401e..3613f57 100644 --- a/ghc/compiler/typecheck/TcBinds.lhs +++ b/ghc/compiler/typecheck/TcBinds.lhs @@ -12,6 +12,7 @@ module TcBinds ( tcBindsAndThen, tcTopBinds, import {-# SOURCE #-} TcMatches ( tcGRHSs, tcMatchesFun ) import {-# SOURCE #-} TcExpr ( tcExpr ) +import CmdLineOpts ( opt_NoMonomorphismRestriction ) import HsSyn ( HsExpr(..), HsBinds(..), MonoBinds(..), Sig(..), StmtCtxt(..), Match(..), collectMonoBinders, andMonoBinds ) @@ -428,7 +429,8 @@ tcBindWithSigs top_lvl mbind tc_ty_sigs inline_sigs is_rec ) where tysig_names = [name | (TySigInfo name _ _ _ _ _ _ _) <- tc_ty_sigs] - is_unrestricted = isUnRestrictedGroup tysig_names mbind + is_unrestricted | opt_NoMonomorphismRestriction = True + | otherwise = isUnRestrictedGroup tysig_names mbind justPatBindings bind@(PatMonoBind _ _ _) binds = bind `andMonoBinds` binds justPatBindings (AndMonoBinds b1 b2) binds = -- 1.7.10.4