Commit 94d8b995 authored by jpm@cs.ox.ac.uk's avatar jpm@cs.ox.ac.uk
Browse files

Implement poly-kinded Typeable

This patch makes the Data.Typeable.Typeable class work with arguments of any
kind. In particular, this removes the Typeable1..7 class hierarchy, greatly
simplyfing the whole Typeable story. Also added is the AutoDeriveTypeable
language extension, which will automatically derive Typeable for all types and
classes declared in that module. Since there is now no good reason to give
handwritten instances of the Typeable class, those are ignored (for backwards
compatibility), and a warning is emitted.

The old, kind-* Typeable class is now called OldTypeable, and lives in the
Data.OldTypeable module. It is deprecated, and should be removed in some future
version of GHC.
parent dc30d983
-- | Unsafe as hand crafts a typeable instance
module UnsafeInfered07_A where
import Data.Typeable
import Data.OldTypeable
data G = G Int
......
......@@ -5,7 +5,7 @@
module Main where
import SafeLang13_A
import Data.Typeable
import Data.OldTypeable
data H = H String deriving (Typeable, Show)
......
......@@ -5,7 +5,7 @@
module Main where
import SafeLang14_A
import Data.Typeable
import Data.OldTypeable
data H = H String deriving (Typeable, Show)
......
......@@ -3,7 +3,7 @@
-- | Here we used typeable to produce an illegal value
module Main where
import Data.Typeable
import Data.OldTypeable
import BadImport02_A
......
......@@ -5,7 +5,7 @@
-- Now using SAFE though so will fail
module Main where
import Data.Typeable
import Data.OldTypeable
import BadImport03_A
......
......@@ -5,7 +5,7 @@
module T2433 where
import Data.Typeable(Typeable1)
import Data.Typeable(Typeable)
import T2433_Help( T )
deriving instance Typeable1 T
deriving instance Typeable T
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