Commit 09cdd12b authored by Simon Peyton Jones's avatar Simon Peyton Jones

Replace Rank2Types and PolymorphicComponents by RankNTypes

parent c6734223
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
module ShouldCompile where
......
{-# LANGUAGE GADTs, ExistentialQuantification, ScopedTypeVariables,
Rank2Types #-}
RankNTypes #-}
-- Here's an example from Doaitse Swiestra (Sept 06)
-- which requires use of scoped type variables
......
{-# LANGUAGE GADTs, Rank2Types #-}
{-# LANGUAGE GADTs, RankNTypes #-}
module ShouldCompile where
......
{-# LANGUAGE GADTs, ExistentialQuantification, KindSignatures, Rank2Types #-}
{-# LANGUAGE GADTs, ExistentialQuantification, KindSignatures, RankNTypes #-}
-- Fails (needs the (Ord a) in TypeSet
-- c.f. gadt22.hs
......
{-# LANGUAGE GADTs, ExistentialQuantification, KindSignatures, Rank2Types #-}
{-# LANGUAGE GADTs, ExistentialQuantification, KindSignatures, RankNTypes #-}
-- Succeeds (needs the (Ord a) in TypeSet
-- c.f. gadt21.hs
......
{-# LANGUAGE GADTs, Rank2Types #-}
{-# LANGUAGE GADTs, RankNTypes #-}
module Main where
......
{-# LANGUAGE GADTs, Rank2Types #-}
{-# LANGUAGE GADTs, RankNTypes #-}
module Termination where
......
:set -XGADTs -XRank2Types -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving
:set -XGADTs -XRankNTypes -XExistentialQuantification -XDeriveDataTypeable -XGeneralizedNewtypeDeriving
:l ../GADT
:a ../Test
:m +Main
......
-- Test handling of extra fields in the representation due to dictionaries
:set -XGADTs -XRank2Types
:set -XGADTs -XRankNTypes
:l ../GADT
let d = DictN (1 :: Integer)
......
-- Test handling of extra fields in the representation due to existentials.
:set -XGADTs -XRank2Types
:set -XGADTs -XRankNTypes
:l ../GADT
let e = Exist 1
......
-- More GADT goodness
:set -XGADTs -XRank2Types -XDeriveDataTypeable -XGeneralizedNewtypeDeriving
:set -XGADTs -XRankNTypes -XDeriveDataTypeable -XGeneralizedNewtypeDeriving
:l ../GADT
:a ../Test
:m +Main
......
{-# LANGUAGE Rank2Types, MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes, MultiParamTypeClasses #-}
-- Tests a bug spotted by Claus in which the type
-- of c3 was wrongly displayed in GHCi as
......
{-# LANGUAGE Rank2Types, MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes, MultiParamTypeClasses #-}
module T where
......
......@@ -3,4 +3,4 @@ test('haddock.Test',
extra_clean(['Test.hi', 'Test.o', 'Hidden.hi', 'Hidden.o',
'Visible.hi', 'Visible.o'])],
multimod_compile,
['Test Hidden Visible', '-XRank2Types -XExistentialQuantification -haddock -ddump-parsed'])
['Test Hidden Visible', '-XRankNTypes -XExistentialQuantification -haddock -ddump-parsed'])
......@@ -23,8 +23,8 @@ test('haddockA022', normal, compile, ['-haddock -ddump-parsed'])
test('haddockA023', normal, compile, ['-haddock -ddump-parsed'])
test('haddockA024', normal, compile, ['-haddock -ddump-parsed'])
test('haddockA025', normal, compile, ['-haddock -ddump-parsed'])
test('haddockA026', normal, compile, ['-haddock -ddump-parsed -XRank2Types'])
test('haddockA027', normal, compile, ['-haddock -ddump-parsed -XRank2Types'])
test('haddockA026', normal, compile, ['-haddock -ddump-parsed -XRankNTypes'])
test('haddockA027', normal, compile, ['-haddock -ddump-parsed -XRankNTypes'])
test('haddockA028', normal, compile, ['-haddock -ddump-parsed -XTypeOperators'])
test('haddockA029', normal, compile, ['-haddock -ddump-parsed'])
test('haddockA030', normal, compile, ['-haddock -ddump-parsed'])
......
......@@ -23,8 +23,8 @@ test('haddockC022', normal, compile, [''])
test('haddockC023', normal, compile, [''])
test('haddockC024', normal, compile, [''])
test('haddockC025', normal, compile, [''])
test('haddockC026', normal, compile, ['-XRank2Types'])
test('haddockC027', normal, compile, ['-XRank2Types'])
test('haddockC026', normal, compile, ['-XRankNTypes'])
test('haddockC027', normal, compile, ['-XRankNTypes'])
test('haddockC028', normal, compile, ['-XTypeOperators'])
test('haddockC029', normal, compile, [''])
test('haddockC030', normal, compile, [''])
......
{-# LANGUAGE TypeFamilies, Rank2Types #-}
{-# LANGUAGE TypeFamilies, RankNTypes #-}
-- This test made the type checker produce an
-- ill-kinded coercion term.
......
......@@ -16,7 +16,7 @@
-- | Module "Trampoline" defines the trampoline computations and their basic building blocks.
{-# LANGUAGE ScopedTypeVariables, Rank2Types, MultiParamTypeClasses, TypeFamilies, KindSignatures,
{-# LANGUAGE ScopedTypeVariables, RankNTypes, MultiParamTypeClasses, TypeFamilies, KindSignatures,
FlexibleContexts, FlexibleInstances, OverlappingInstances, UndecidableInstances
#-}
......
{-# LANGUAGE Rank2Types, TypeFamilies #-}
{-# LANGUAGE RankNTypes, TypeFamilies #-}
-- Unification yielding a coercion under a forall
......
{-# LANGUAGE
FlexibleContexts,
Rank2Types,
RankNTypes,
TypeFamilies,
MultiParamTypeClasses,
FlexibleInstances #-}
......
{-# LANGUAGE TypeFamilies, Rank2Types, FlexibleContexts #-}
{-# LANGUAGE TypeFamilies, RankNTypes, FlexibleContexts #-}
module T4358 where
......
{-# LANGUAGE TypeFamilies, Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies, RankNTypes, ScopedTypeVariables #-}
module T4935 where
import Control.Applicative
......
{-# LANGUAGE Rank2Types, MultiParamTypeClasses, FlexibleContexts,
{-# LANGUAGE RankNTypes, MultiParamTypeClasses, FlexibleContexts,
TypeFamilies, ScopedTypeVariables #-}
module T7280 where
......
{-# LANGUAGE TypeFamilies, Rank2Types #-}
{-# LANGUAGE TypeFamilies, RankNTypes #-}
module ShouldFail where
......
......@@ -3,7 +3,7 @@
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
......
{-# LANGUAGE RebindableSyntax, NPlusKPatterns, Rank2Types,
{-# LANGUAGE RebindableSyntax, NPlusKPatterns, RankNTypes,
ScopedTypeVariables, FlexibleInstances #-}
module Main where
{
......
......@@ -2,7 +2,7 @@
--
-- Test trying to use a function bound in the list comprehension as the transform function
{-# OPTIONS_GHC -XRank2Types -XMonadComprehensions -XTransformListComp #-}
{-# OPTIONS_GHC -XRankNTypes -XMonadComprehensions -XTransformListComp #-}
module RnFail048 where
......
......@@ -2,7 +2,7 @@
--
-- Test trying to use a function bound in the list comprehension as the group function
{-# OPTIONS_GHC -XRank2Types -XMonadComprehensions -XTransformListComp #-}
{-# OPTIONS_GHC -XRankNTypes -XMonadComprehensions -XTransformListComp #-}
module RnFail049 where
......
{-# LANGUAGE Rank2Types, FlexibleInstances #-}
{-# LANGUAGE RankNTypes, FlexibleInstances #-}
-- This one made ghc-4.08 crash
-- rename/RnEnv.lhs:239: Non-exhaustive patterns in function get_tycon_key
......
-- Test trying to use a function bound in the list comprehension as the group function
{-# OPTIONS_GHC -XRank2Types -XTransformListComp #-}
{-# OPTIONS_GHC -XRankNTypes -XTransformListComp #-}
module RnFail049 where
......
-- Test trying to use a function bound in the list comprehension as the transform function
{-# OPTIONS_GHC -XRank2Types -XTransformListComp #-}
{-# OPTIONS_GHC -XRankNTypes -XTransformListComp #-}
module RnFail048 where
......
{-# LANGUAGE BangPatterns, Rank2Types, MagicHash, UnboxedTuples #-}
{-# LANGUAGE BangPatterns, RankNTypes, MagicHash, UnboxedTuples #-}
module T5359a (linesT) where
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_GHC -dcore-lint #-}
-- This one killed GHC 6.0, with a "panic: applyTys"
......
{-# LANGUAGE CPP, Rank2Types, ScopedTypeVariables, KindSignatures,
{-# LANGUAGE CPP, RankNTypes, ScopedTypeVariables, KindSignatures,
MultiParamTypeClasses, FunctionalDependencies #-}
-- This one triggered a bug in the indirection-shorting
......
{-# LANGUAGE Rank2Types, GADTs, FlexibleContexts #-}
{-# LANGUAGE RankNTypes, GADTs, FlexibleContexts #-}
{-# OPTIONS_GHC -O2 #-}
-- This one make SpecConstr generate bogus code (hence -O2),
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
-- Trac #2494, should compile ok
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
-- Trac #2494, should generate an error message
......
{-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses,
FunctionalDependencies, Rank2Types #-}
FunctionalDependencies, RankNTypes #-}
module Q where
......
{-# LANGUAGE OverlappingInstances , UndecidableInstances, EmptyDataDecls #-}
{-# LANGUAGE Rank2Types, KindSignatures, MultiParamTypeClasses, FlexibleInstances #-}
{-# LANGUAGE RankNTypes, KindSignatures, MultiParamTypeClasses, FlexibleInstances #-}
-- Works with new constraint solver
......
{-# LANGUAGE DeriveDataTypeable, ExistentialQuantification, Rank2Types, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, FlexibleContexts, PatternGuards, DatatypeContexts #-}
{-# LANGUAGE DeriveDataTypeable, ExistentialQuantification, RankNTypes, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, FlexibleContexts, PatternGuards, DatatypeContexts #-}
module T4355 where
......
{-# LANGUAGE TypeFamilies, GADTs, ConstraintKinds, Rank2Types #-}
{-# LANGUAGE TypeFamilies, GADTs, ConstraintKinds, RankNTypes #-}
module T5655 where
import GHC.Prim (Constraint)
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- A classic test for type inference
-- Taken from "Haskell and principal types", Section 3
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
module ShouldSucceed where
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
module ShouldSucceed where
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- !!! Local universal quantification.
module ShouldSucceed where
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
-- !!! Caused ghc-4.04proto to report a bogus type error
-- !!! (as reported by Keith)
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
module ShouldCompile where
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- !!! Rank 2 polymorphism
-- Both f and g are rejected by Hugs [April 2001]
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- Make sure for-alls can occur in data types
......
{-# LANGUAGE ImplicitParams, Rank2Types #-}
{-# LANGUAGE ImplicitParams, RankNTypes #-}
-- Rank-2 types with implicit parameters.
-- GHC 5.02 erroneously rejected this
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- The interesting thign about this one is that
-- there's an unbound type variable of kind *->*
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- This program tickled a bug in 5.02.2's forall-lifting
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- Test silly type synonyms
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
--Tests alpha-renaming in with extended type-synonyms
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- Blew up GHC 5.04, with:
-- Ambiguous type variable(s) `q' in the constraint `Foo q'
-- arising from a function with an overloaded argument type at Foo.hs:7
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- These ones failed with 5.04. They need a coercion
-- in the pattern matching compiler, so they are a bit
......
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
ExistentialQuantification, Rank2Types,
ExistentialQuantification, RankNTypes,
FlexibleInstances #-}
-- Arguably, the type signature for f1 should be enough to make
......
{-# LANGUAGE ExistentialQuantification, Rank2Types #-}
{-# LANGUAGE ExistentialQuantification, RankNTypes #-}
-- An interesting interaction of universals and existentials, prompted by
-- http://www.haskell.org/pipermail/haskell-cafe/2004-October/007160.html
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
-- Tests the special case of
-- non-recursive, function binding,
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
-- This should work, because the type sig and the type
-- in the pattern match exactly
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- Check that we can have a forall after a forall
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- This one showed up a bug in pre-subsumption
......
{-# LANGUAGE ImplicitParams, Rank2Types #-}
{-# LANGUAGE ImplicitParams, RankNTypes #-}
-- This program failed to typecheck in an early version of
-- GHC with impredicative polymorphism, but it was fixed by
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
module ShouldCompile where
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables, FlexibleInstances,
{-# LANGUAGE RankNTypes, ScopedTypeVariables, FlexibleInstances,
MultiParamTypeClasses, FunctionalDependencies #-}
-- This tests scoped type variables, used in an expression
......
{-# LANGUAGE ImplicitParams, Rank2Types #-}
{-# LANGUAGE ImplicitParams, RankNTypes #-}
-- Tests impredivative polymorphism with left-to-right
-- flow information; see the uses of "$"
......
......@@ -2,7 +2,7 @@
-- trac #1406: Constraint doesn't reduce in the presence of quantified
-- type variables
{-# LANGUAGE FlexibleInstances, UndecidableInstances, Rank2Types,
{-# LANGUAGE FlexibleInstances, UndecidableInstances, RankNTypes,
MultiParamTypeClasses, FunctionalDependencies #-}
module Problem where
......
{-# OPTIONS_GHC -XPolymorphicComponents #-}
{-# LANGUAGE RankNTypes #-}
module ShouldCompile where
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
module ShouldCompile where
......
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE UndecidableInstances #-}
......
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
module T7019a where
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
{-
From: Ralf Hinze <ralf@uran.informatik.uni-bonn.de>
......
{-# LANGUAGE Rank2Types, FlexibleInstances #-}
{-# LANGUAGE RankNTypes, FlexibleInstances #-}
-- !!! Check that forall types can't be arguments
module ShouldFail where
......
{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
-- Test the handling of conditionals in rank-n stuff
-- Should fail, regardless of branch ordering
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
module ShouldCompile where
......
{-# LANGUAGE Rank2Types, KindSignatures #-}
{-# LANGUAGE RankNTypes, KindSignatures #-}
module ShouldFail where
......
{-# LANGUAGE Rank2Types, KindSignatures #-}
{-# LANGUAGE RankNTypes, KindSignatures #-}
{-# OPTIONS_GHC -Werror #-}
-- Trac #959
......
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE RankNTypes #-}
-- Claus reported by email that
......
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