summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKC Sivaramakrishnan <chandras@cs.purdue.edu>2013-09-27 17:30:39 -0400
committerKC Sivaramakrishnan <chandras@cs.purdue.edu>2013-09-27 17:30:39 -0400
commit9b98c6de7da094d2c8e77f0fe6a6fb4e6bd15069 (patch)
treeba116bc3d09d01535c50fad36815837838aecd3d
parenteb0c7f85c5e660a8ff96486edc992f979b233a20 (diff)
parentfa3ffb43144eadc406031110b01ba3dc4f9bd94e (diff)
downloadhaskell-9b98c6de7da094d2c8e77f0fe6a6fb4e6bd15069.tar.gz
Merging master
-rw-r--r--compiler/basicTypes/MkId.lhs19
-rw-r--r--compiler/ghci/RtClosureInspect.hs1
-rw-r--r--compiler/prelude/PrelNames.lhs8
-rw-r--r--compiler/prelude/TysPrim.lhs15
-rw-r--r--docs/users_guide/7.8.1-notes.xml11
-rw-r--r--docs/users_guide/glasgow_exts.xml16
m---------libraries/vector0
-rw-r--r--packages4
8 files changed, 61 insertions, 13 deletions
diff --git a/compiler/basicTypes/MkId.lhs b/compiler/basicTypes/MkId.lhs
index 45d94598ea..252384d03d 100644
--- a/compiler/basicTypes/MkId.lhs
+++ b/compiler/basicTypes/MkId.lhs
@@ -138,7 +138,8 @@ ghcPrimIds
nullAddrId,
seqId,
magicSingIId,
- coerceId
+ coerceId,
+ proxyHashId
]
\end{code}
@@ -1037,7 +1038,7 @@ they can unify with both unlifted and lifted types. Hence we provide
another gun with which to shoot yourself in the foot.
\begin{code}
-lazyIdName, unsafeCoerceName, nullAddrName, seqName, realWorldName, coercionTokenName, magicSingIName, coerceName :: Name
+lazyIdName, unsafeCoerceName, nullAddrName, seqName, realWorldName, coercionTokenName, magicSingIName, coerceName, proxyName :: Name
unsafeCoerceName = mkWiredInIdName gHC_PRIM (fsLit "unsafeCoerce#") unsafeCoerceIdKey unsafeCoerceId
nullAddrName = mkWiredInIdName gHC_PRIM (fsLit "nullAddr#") nullAddrIdKey nullAddrId
seqName = mkWiredInIdName gHC_PRIM (fsLit "seq") seqIdKey seqId
@@ -1046,9 +1047,23 @@ lazyIdName = mkWiredInIdName gHC_MAGIC (fsLit "lazy") lazyIdKey
coercionTokenName = mkWiredInIdName gHC_PRIM (fsLit "coercionToken#") coercionTokenIdKey coercionTokenId
magicSingIName = mkWiredInIdName gHC_PRIM (fsLit "magicSingI") magicSingIKey magicSingIId
coerceName = mkWiredInIdName gHC_PRIM (fsLit "coerce") coerceKey coerceId
+proxyName = mkWiredInIdName gHC_PRIM (fsLit "proxy#") proxyHashKey proxyHashId
\end{code}
\begin{code}
+
+------------------------------------------------
+-- proxy# :: forall a. Proxy# a
+proxyHashId :: Id
+proxyHashId
+ = pcMiscPrelId proxyName ty noCafIdInfo
+ where
+ ty = mkForAllTys [kv, tv] (mkProxyPrimTy k t)
+ kv = kKiVar
+ k = mkTyVarTy kv
+ tv:_ = tyVarList k
+ t = mkTyVarTy tv
+
------------------------------------------------
-- unsafeCoerce# :: forall a b. a -> b
unsafeCoerceId :: Id
diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs
index 9a5edbdc01..c02b87cfd7 100644
--- a/compiler/ghci/RtClosureInspect.hs
+++ b/compiler/ghci/RtClosureInspect.hs
@@ -508,6 +508,7 @@ repPrim t = rep where
| t == stablePtrPrimTyCon = text "<stablePtr>"
| t == stableNamePrimTyCon = text "<stableName>"
| t == statePrimTyCon = text "<statethread>"
+ | t == proxyPrimTyCon = text "<proxy>"
| t == realWorldTyCon = text "<realworld>"
| t == threadIdPrimTyCon = text "<ThreadId>"
| t == weakPrimTyCon = text "<Weak>"
diff --git a/compiler/prelude/PrelNames.lhs b/compiler/prelude/PrelNames.lhs
index 632748a0bc..1c5f800e87 100644
--- a/compiler/prelude/PrelNames.lhs
+++ b/compiler/prelude/PrelNames.lhs
@@ -636,7 +636,7 @@ showParen_RDR = varQual_RDR gHC_SHOW (fsLit "showParen")
typeRep_RDR, mkTyCon_RDR, mkTyConApp_RDR,
oldTypeOf_RDR, oldMkTyCon_RDR, oldMkTyConApp_RDR :: RdrName
-typeRep_RDR = varQual_RDR tYPEABLE_INTERNAL (fsLit "typeRep")
+typeRep_RDR = varQual_RDR tYPEABLE_INTERNAL (fsLit "typeRep#")
mkTyCon_RDR = varQual_RDR tYPEABLE_INTERNAL (fsLit "mkTyCon")
mkTyConApp_RDR = varQual_RDR tYPEABLE_INTERNAL (fsLit "mkTyConApp")
oldTypeOf_RDR = varQual_RDR oLDTYPEABLE_INTERNAL (fsLit "typeOf")
@@ -1481,6 +1481,9 @@ ntTyConKey = mkPreludeTyConUnique 174
coercibleTyConKey :: Unique
coercibleTyConKey = mkPreludeTyConUnique 175
+proxyPrimTyConKey :: Unique
+proxyPrimTyConKey = mkPreludeTyConUnique 176
+
---------------- Template Haskell -------------------
-- USES TyConUniques 200-299
-----------------------------------------------------
@@ -1794,6 +1797,9 @@ fromListClassOpKey = mkPreludeMiscIdUnique 199
fromListNClassOpKey = mkPreludeMiscIdUnique 500
toListClassOpKey = mkPreludeMiscIdUnique 501
+proxyHashKey :: Unique
+proxyHashKey = mkPreludeMiscIdUnique 502
+
---------------- Template Haskell -------------------
-- USES IdUniques 200-499
-----------------------------------------------------
diff --git a/compiler/prelude/TysPrim.lhs b/compiler/prelude/TysPrim.lhs
index cf17a0f67c..13b04c688a 100644
--- a/compiler/prelude/TysPrim.lhs
+++ b/compiler/prelude/TysPrim.lhs
@@ -48,6 +48,8 @@ module TysPrim(
statePrimTyCon, mkStatePrimTy,
realWorldTyCon, realWorldTy, realWorldStatePrimTy,
+ proxyPrimTyCon, mkProxyPrimTy,
+
arrayPrimTyCon, mkArrayPrimTy,
byteArrayPrimTyCon, byteArrayPrimTy,
arrayArrayPrimTyCon, mkArrayArrayPrimTy,
@@ -127,6 +129,7 @@ primTyCons
, stablePtrPrimTyCon
, stableNamePrimTyCon
, statePrimTyCon
+ , proxyPrimTyCon
, threadIdPrimTyCon
, sContPrimTyCon
, wordPrimTyCon
@@ -153,7 +156,7 @@ mkPrimTc fs unique tycon
(ATyCon tycon) -- Relevant TyCon
UserSyntax -- None are built-in syntax
-charPrimTyConName, intPrimTyConName, int32PrimTyConName, int64PrimTyConName, wordPrimTyConName, word32PrimTyConName, word64PrimTyConName, addrPrimTyConName, floatPrimTyConName, doublePrimTyConName, statePrimTyConName, realWorldTyConName, arrayPrimTyConName, arrayArrayPrimTyConName, byteArrayPrimTyConName, mutableArrayPrimTyConName, mutableByteArrayPrimTyConName, mutableArrayArrayPrimTyConName, mutVarPrimTyConName, mVarPrimTyConName, tVarPrimTyConName, stablePtrPrimTyConName, stableNamePrimTyConName, bcoPrimTyConName, weakPrimTyConName, threadIdPrimTyConName, sContPrimTyConName, eqPrimTyConName, eqReprPrimTyConName :: Name
+charPrimTyConName, intPrimTyConName, int32PrimTyConName, int64PrimTyConName, wordPrimTyConName, word32PrimTyConName, word64PrimTyConName, addrPrimTyConName, floatPrimTyConName, doublePrimTyConName, statePrimTyConName, proxyPrimTyConName, realWorldTyConName, arrayPrimTyConName, arrayArrayPrimTyConName, byteArrayPrimTyConName, mutableArrayPrimTyConName, mutableByteArrayPrimTyConName, mutableArrayArrayPrimTyConName, mutVarPrimTyConName, mVarPrimTyConName, tVarPrimTyConName, stablePtrPrimTyConName, stableNamePrimTyConName, bcoPrimTyConName, weakPrimTyConName, threadIdPrimTyConName, sContPrimTyConName, eqPrimTyConName, eqReprPrimTyConName :: Name
charPrimTyConName = mkPrimTc (fsLit "Char#") charPrimTyConKey charPrimTyCon
intPrimTyConName = mkPrimTc (fsLit "Int#") intPrimTyConKey intPrimTyCon
int32PrimTyConName = mkPrimTc (fsLit "Int32#") int32PrimTyConKey int32PrimTyCon
@@ -165,6 +168,7 @@ addrPrimTyConName = mkPrimTc (fsLit "Addr#") addrPrimTyConKey addrPrim
floatPrimTyConName = mkPrimTc (fsLit "Float#") floatPrimTyConKey floatPrimTyCon
doublePrimTyConName = mkPrimTc (fsLit "Double#") doublePrimTyConKey doublePrimTyCon
statePrimTyConName = mkPrimTc (fsLit "State#") statePrimTyConKey statePrimTyCon
+proxyPrimTyConName = mkPrimTc (fsLit "Proxy#") proxyPrimTyConKey proxyPrimTyCon
eqPrimTyConName = mkPrimTc (fsLit "~#") eqPrimTyConKey eqPrimTyCon
eqReprPrimTyConName = mkPrimTc (fsLit "~R#") eqReprPrimTyConKey eqReprPrimTyCon
realWorldTyConName = mkPrimTc (fsLit "RealWorld") realWorldTyConKey realWorldTyCon
@@ -476,6 +480,15 @@ mkStatePrimTy ty = TyConApp statePrimTyCon [ty]
statePrimTyCon :: TyCon -- See Note [The State# TyCon]
statePrimTyCon = pcPrimTyCon statePrimTyConName [Nominal] VoidRep
+mkProxyPrimTy :: Type -> Type -> Type
+mkProxyPrimTy k ty = TyConApp proxyPrimTyCon [k, ty]
+
+proxyPrimTyCon :: TyCon
+proxyPrimTyCon = mkPrimTyCon proxyPrimTyConName kind [Nominal,Nominal] VoidRep
+ where kind = ForAllTy kv $ mkArrowKind k unliftedTypeKind
+ kv = kKiVar
+ k = mkTyVarTy kv
+
eqPrimTyCon :: TyCon -- The representation type for equality predicates
-- See Note [The ~# TyCon]
eqPrimTyCon = mkPrimTyCon eqPrimTyConName kind [Nominal, Nominal, Nominal] VoidRep
diff --git a/docs/users_guide/7.8.1-notes.xml b/docs/users_guide/7.8.1-notes.xml
index 52f3e7ca1b..16e89e9500 100644
--- a/docs/users_guide/7.8.1-notes.xml
+++ b/docs/users_guide/7.8.1-notes.xml
@@ -300,6 +300,17 @@
<itemizedlist>
<listitem>
<para>
+ There is a new extension,
+ <literal>EmptyCase</literal>, which allows
+ to write a case expression with no alternatives
+ <literal>case ... of {}</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <listitem>
+ <para>
The <literal>IncoherentInstances</literal>
extension has seen a behavioral change, and is
now 'liberated' and less conservative during
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 43fa155e72..d8189040ce 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -6941,7 +6941,11 @@ explicit context. For example in the first argument of the
constructor <function>MkSwizzle</function>, an implicit "<literal>forall a.</literal>" is
prefixed to the argument type. The implicit <literal>forall</literal>
quantifies all type variables that are not already in scope, and are
-mentioned in the type quantified over.
+mentioned in the type quantified over. (Arguably, it would be better
+to <emphasis>require</emphasis> explicit quantification on constructor arguments
+where that is what is wanted.
+See <ulink url="http://ghc.haskell.org/trac/ghc/ticket/4426">Trac #4426</ulink>.)
+
</para>
<para>
@@ -6949,19 +6953,17 @@ As for type signatures, implicit quantification happens for non-overloaded
types too. So if you write this:
<programlisting>
- data T a = MkT (Either a b) (b -> b)
+ f :: (a -> a) -> a
</programlisting>
it's just as if you had written this:
<programlisting>
- data T a = MkT (forall b. Either a b) (forall b. b -> b)
+ f :: forall a. (a -> a) -> a
</programlisting>
-That is, since the type variable <literal>b</literal> isn't in scope, it's
-implicitly universally quantified. (Arguably, it would be better
-to <emphasis>require</emphasis> explicit quantification on constructor arguments
-where that is what is wanted. Feedback welcomed.)
+That is, since the type variable <literal>a</literal> isn't in scope, it's
+implicitly universally quantified.
</para>
<para>
diff --git a/libraries/vector b/libraries/vector
-Subproject 092c051e2918fa8fcd71d2971402fbe3710afb0
+Subproject 36e221d646ae1270a6bde6b9f798c2e94c8bbde
diff --git a/packages b/packages
index 893c291ce1..3a9d4a68ed 100644
--- a/packages
+++ b/packages
@@ -82,7 +82,7 @@ nofib nofib nofib.git -
libraries/parallel extra packages/parallel.git -
libraries/stm extra packages/stm.git -
libraries/random dph - -
-libraries/primitive dph - http://git.haskell.org/darcs-mirrors/primitive.git
-libraries/vector dph - http://git.haskell.org/darcs-mirrors/vector.git
+libraries/primitive dph - https://github.com/haskell/primitive.git
+libraries/vector dph - https://github.com/haskell/vector.git
libraries/dph dph packages/dph.git -
. - ghc.git -