Commit 597cbf70 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Add flags for Rank2Types and RankNTypes

parent 4788de9a
......@@ -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
......
......@@ -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
......
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