Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
597cbf70
Commit
597cbf70
authored
Jul 08, 2007
by
Ian Lynagh
Browse files
Add flags for Rank2Types and RankNTypes
parent
4788de9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
compiler/main/DynFlags.hs
View file @
597cbf70
...
...
@@ -194,6 +194,8 @@ data DynFlag
|
Opt_GeneralizedNewtypeDeriving
|
Opt_RecursiveDo
|
Opt_PatternGuards
|
Opt_Rank2Types
|
Opt_RankNTypes
-- optimisation opts
|
Opt_Strictness
...
...
@@ -1113,6 +1115,8 @@ xFlags = [
(
"FFI"
,
Opt_FFI
),
-- ...and also `-fffi'
(
"ForeignFunctionInterface"
,
Opt_FFI
),
(
"Rank2Types"
,
Opt_Rank2Types
),
(
"RankNTypes"
,
Opt_RankNTypes
),
(
"RecursiveDo"
,
Opt_RecursiveDo
),
(
"Arrows"
,
Opt_Arrows
),
-- arrow syntax
(
"Parr"
,
Opt_PArr
),
...
...
@@ -1164,6 +1168,7 @@ glasgowExtsFlags = [ Opt_GlasgowExts
,
Opt_FunctionalDependencies
,
Opt_MagicHash
,
Opt_PatternGuards
,
Opt_RankNTypes
,
Opt_RecursiveDo
,
Opt_ParallelListComp
,
Opt_EmptyDataDecls
...
...
compiler/typecheck/TcMType.lhs
View file @
597cbf70
...
...
@@ -695,8 +695,11 @@ checkValidType :: UserTypeCtxt -> Type -> TcM ()
checkValidType ctxt ty
= traceTc (text "checkValidType" <+> ppr ty) `thenM_`
doptM Opt_GlasgowExts `thenM` \ gla_exts ->
doptM Opt_Rank2Types `thenM` \ rank2 ->
doptM Opt_RankNTypes `thenM` \ rankn ->
let
rank | gla_exts = Arbitrary
rank | rankn = Arbitrary
| rank2 = Rank 2
| otherwise
= case ctxt of -- Haskell 98
GenPatCtxt -> Rank 0
...
...
Write
Preview
Supports
Markdown
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