diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2014-01-30 16:28:00 +0000 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2014-01-30 16:28:00 +0000 |
commit | 1dd38a54bb29387d9e9c549dbb020bc9ed4ecb91 (patch) | |
tree | 23cf422284edb28800253234ffac90935621e4af /compiler/prelude/primops.txt.pp | |
parent | 044f23388c0c316fbc470c93860797a30b3130bd (diff) | |
download | haskell-1dd38a54bb29387d9e9c549dbb020bc9ed4ecb91.tar.gz |
Remove Coercible documentation from compiler/prelude/primops.txt.pp
We want it to show up in GHC.Exts, so we need to put the documentation
in GHC.Types, where the datatype Coercible is defined.
Diffstat (limited to 'compiler/prelude/primops.txt.pp')
-rw-r--r-- | compiler/prelude/primops.txt.pp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 36eec67b7d..d2978dc730 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2365,47 +2365,6 @@ pseudoop "coerce" } primclass Coercible a b - { This two-parameter class has instances for types {\tt a} and {\tt b} if - the compiler can infer that they have the same representation. This class - does not have regular instances; instead they are created on-the-fly during - type-checking. Trying to manually declare an instance of {\tt Coercible} - is an error. - - Nevertheless one can pretend that the following three kinds of instances - exist. First, as a trivial base-case: - - {\tt instance a a} - - Furthermore, for every type constructor there is - an instance that allows to coerce under the type constructor. For - example, let {\tt D} be a prototypical type constructor ({\tt data} or {\tt - newtype}) with three type arguments, which have roles Nominal, - Representational resp. Phantom. Then there is an instance of the form - - {\tt instance Coercible b b' => Coercible (D a b c) (D a b' c')} - - Note that the nominal type arguments are equal, the representational type - arguments can differ, but need to have a {\tt Coercible} instance - themself, and the phantom type arguments can be changed arbitrarily. - - In SafeHaskell code, this instance is only usable if the constructors of - every type constructor used in the definition of {\tt D} (including - those of {\tt D} itself) are in scope. - - The third kind of instance exists for every {\tt newtype NT = MkNT T} and - comes in two variants, namely - - {\tt instance Coercible a T => Coercible a NT} - - {\tt instance Coercible T b => Coercible NT b} - - This instance is only usable if the constructor {\tt MkNT} is in scope. - - If, as a library author of a type constructor like {\tt Set a}, you - want to prevent a user of your module to write - {\tt coerce :: Set T -> Set NT}, - you need to set the role of {\tt Set}'s type parameter to Nominal. - } ------------------------------------------------------------------------ section "SIMD Vectors" |