Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LinuxUser GD
GHC
Commits
2f115a13
Commit
2f115a13
authored
8 years ago
by
Edward Z. Yang
Browse files
Options
Downloads
Patches
Plain Diff
A few remarks on role subtyping in the manual.
Signed-off-by:
Edward Z. Yang
<
ezyang@cs.stanford.edu
>
parent
cd9c7094
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/users_guide/separate_compilation.rst
+9
-1
9 additions, 1 deletion
docs/users_guide/separate_compilation.rst
with
9 additions
and
1 deletion
docs/users_guide/separate_compilation.rst
+
9
−
1
View file @
2f115a13
...
@@ -917,11 +917,17 @@ to ``hs-boot`` files, but with some slight changes:
...
@@ -917,11 +917,17 @@ to ``hs-boot`` files, but with some slight changes:
relation ``phantom < representational < nominal``: for example,
relation ``phantom < representational < nominal``: for example,
an abstract type with a nominal type parameter can be implemented
an abstract type with a nominal type parameter can be implemented
using a concrete type with a representational type parameter.
using a concrete type with a representational type parameter.
Merging respects this subtyping relation (e.g., ``nominal``
merged with ``representational`` is ``representational``.)
Roles in signatures default to ``nominal``, which gives maximum
Roles in signatures default to ``nominal``, which gives maximum
flexibility on the implementor's side. You should only need to
flexibility on the implementor's side. You should only need to
give an explicit role annotation if a client of the signature
give an explicit role annotation if a client of the signature
would like to coerce the abstract type in a type parameter (in which case you
would like to coerce the abstract type in a type parameter (in which case you
should specify ``representational`` explicitly.)
should specify ``representational`` explicitly.) Unlike
regular data types, we do *not* assume that abstract
data types are representationally injective: if we have
``Coercible (T a) (T b)``, and ``T`` has role ``nominal``,
this does not imply that ``a ~ b``.
- A class declarations can either be abstract or concrete. An
- A class declarations can either be abstract or concrete. An
abstract class is one with no superclasses or class methods::
abstract class is one with no superclasses or class methods::
...
@@ -990,6 +996,8 @@ to ``hs-boot`` files, but with some slight changes:
...
@@ -990,6 +996,8 @@ to ``hs-boot`` files, but with some slight changes:
Known limitations:
Known limitations:
- Pattern synonyms are not supported.
- Algebraic data types specified in a signature cannot be implemented using
- Algebraic data types specified in a signature cannot be implemented using
pattern synonyms. See :ghc-ticket:`12717`
pattern synonyms. See :ghc-ticket:`12717`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment