Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
44e3fc1f
Commit
44e3fc1f
authored
Jul 08, 2007
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -XMultiParamTypeClasses flag
parent
c0cc5433
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
compiler/main/DynFlags.hs
compiler/main/DynFlags.hs
+3
-0
compiler/typecheck/TcTyClsDecls.lhs
compiler/typecheck/TcTyClsDecls.lhs
+3
-2
No files found.
compiler/main/DynFlags.hs
View file @
44e3fc1f
...
...
@@ -183,6 +183,7 @@ data DynFlag
|
Opt_RecordPuns
|
Opt_GADTs
|
Opt_RelaxedPolyRec
-- -X=RelaxedPolyRec
|
Opt_MultiParamTypeClasses
|
Opt_MagicHash
|
Opt_EmptyDataDecls
|
Opt_KindSignatures
...
...
@@ -1126,6 +1127,7 @@ xFlags = [
(
"ExtendedDefaultRules"
,
Opt_ExtendedDefaultRules
),
(
"ImplicitParams"
,
Opt_ImplicitParams
),
(
"ScopedTypeVariables"
,
Opt_ScopedTypeVariables
),
(
"MultiParamTypeClasses"
,
Opt_MultiParamTypeClasses
),
(
"AllowOverlappingInstances"
,
Opt_AllowOverlappingInstances
),
(
"AllowUndecidableInstances"
,
Opt_AllowUndecidableInstances
),
(
"AllowIncoherentInstances"
,
Opt_AllowIncoherentInstances
)
...
...
@@ -1141,6 +1143,7 @@ glasgowExtsFlags = [ Opt_GlasgowExts
,
Opt_GADTs
,
Opt_ImplicitParams
,
Opt_ScopedTypeVariables
,
Opt_MultiParamTypeClasses
,
Opt_MagicHash
,
Opt_EmptyDataDecls
,
Opt_KindSignatures
...
...
compiler/typecheck/TcTyClsDecls.lhs
View file @
44e3fc1f
...
...
@@ -1060,10 +1060,11 @@ checkValidClass :: Class -> TcM ()
checkValidClass cls
= do { -- CHECK ARITY 1 FOR HASKELL 1.4
gla_exts <- doptM Opt_GlasgowExts
; multi_param_type_classes <- doptM Opt_MultiParamTypeClasses
-- Check that the class is unary, unless GlaExs
; checkTc (notNull tyvars) (nullaryClassErr cls)
; checkTc (
gla_ext
s || unary) (classArityErr cls)
; checkTc (
multi_param_type_classe
s || unary) (classArityErr cls)
-- Check the super-classes
; checkValidTheta (ClassSCCtxt (className cls)) theta
...
...
@@ -1138,7 +1139,7 @@ nullaryClassErr cls
classArityErr cls
= vcat [ptext SLIT("Too many parameters for class") <+> quotes (ppr cls),
parens (ptext SLIT("Use -
fglasgow-ext
s to allow multi-parameter classes"))]
parens (ptext SLIT("Use -
XMultiParamTypeClasse
s to allow multi-parameter classes"))]
noClassTyVarErr clas op
= sep [ptext SLIT("The class method") <+> quotes (ppr op),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment