Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,323
Issues
4,323
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
376
Merge Requests
376
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
051d694f
Commit
051d694f
authored
Jun 10, 2014
by
eir@cis.upenn.edu
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
#9097
.
`Any` is now an abstract (that is, no equations) closed type family.
parent
0f584ae3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
compiler/prelude/TysPrim.lhs
compiler/prelude/TysPrim.lhs
+4
-12
compiler/prelude/primops.txt.pp
compiler/prelude/primops.txt.pp
+6
-3
No files found.
compiler/prelude/TysPrim.lhs
View file @
051d694f
...
...
@@ -701,7 +701,7 @@ threadIdPrimTyCon = pcPrimTyCon0 threadIdPrimTyConName PtrRep
Note [Any types]
~~~~~~~~~~~~~~~~
The type constructor Any of kind forall k. k
-> k
has these properties:
The type constructor Any of kind forall k. k has these properties:
* It is defined in module GHC.Prim, and exported so that it is
available to users. For this reason it's treated like any other
...
...
@@ -714,7 +714,7 @@ The type constructor Any of kind forall k. k -> k has these properties:
g :: ty ~ (Fst ty, Snd ty)
If Any was a *data* type, then we'd get inconsistency because 'ty'
could be (Any '(k1,k2)) and then we'd have an equality with Any on
one side and '(,) on the other
one side and '(,) on the other
. See also #9097.
* It is lifted, and hence represented by a pointer
...
...
@@ -771,20 +771,12 @@ anyTy :: Type
anyTy = mkTyConTy anyTyCon
anyTyCon :: TyCon
anyTyCon = mkLiftedPrimTyCon anyTyConName kind [Nominal] PtrRep
where kind = ForAllTy kKiVar (mkTyVarTy kKiVar)
{- Can't do this yet without messing up kind proxies
-- RAE: I think you can now.
anyTyCon :: TyCon
anyTyCon = mkSynTyCon anyTyConName kind [kKiVar]
anyTyCon = mkSynTyCon anyTyConName kind [kKiVar] [Nominal]
syn_rhs
NoParentTyCon
where
kind = ForAllTy kKiVar (mkTyVarTy kKiVar)
syn_rhs = SynFamilyTyCon { synf_open = False, synf_injective = True }
-- NB Closed, injective
-}
syn_rhs = AbstractClosedSynFamilyTyCon
anyTypeOfKind :: Kind -> Type
anyTypeOfKind kind = TyConApp anyTyCon [kind]
...
...
compiler/prelude/primops.txt.pp
View file @
051d694f
...
...
@@ -2437,7 +2437,7 @@ pseudoop "seq"
{ Evaluates its first argument to head normal form, and then returns its second
argument as the result. }
primtype Any
k
primtype Any
{ The type constructor {\tt Any} is type to which you can unsafely coerce any
lifted type, and back.
...
...
@@ -2462,8 +2462,11 @@ primtype Any k
{\tt length (Any *) ([] (Any *))}
Note that {\tt Any} is kind polymorphic, and takes a kind {\tt k} as its
first argument. The kind of {\tt Any} is thus {\tt forall k. k -> k}.}
Above, we print kinds explicitly, as if with
{\tt -fprint-explicit-kinds}.
Note that {\tt Any} is kind polymorphic; its kind is thus
{\tt forall k. k}.}
primtype AnyK
{ The kind {\tt AnyK} is the kind level counterpart to {\tt Any}. In a
...
...
Herbert Valerio Riedel
🕺
@hvr
mentioned in commit
9dfdd16a
·
Mar 20, 2015
mentioned in commit
9dfdd16a
mentioned in commit 9dfdd16a61e79cb03c633d442190a81fe5c0b6b8
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment