Skip to content

Sync with the stable documentation branch #16483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 174 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
f9a921b
GitHub pages workflow
szymon-rd Aug 29, 2022
6600a2d
pirst part of changes
kamilszewczyk0 Sep 1, 2022
455fbd2
GitHub pages workflow
szymon-rd Aug 29, 2022
3efe571
Display packages in nested way in sidebar
Florian3k Aug 31, 2022
de18cd0
Scaladoc Search Engine fixes
szymon-rd Aug 29, 2022
4b11ad4
Working search engine
szymon-rd Sep 1, 2022
4031e33
Optimized & added features to search
szymon-rd Sep 5, 2022
cb6ef8a
Formatting fixes
szymon-rd Sep 5, 2022
01421ba
Better scoring & faster debounce
szymon-rd Sep 5, 2022
0006447
Testes search engine
szymon-rd Sep 6, 2022
dc1e368
Remove div from search results
szymon-rd Sep 6, 2022
0a0b2fb
Removed Attributes header
szymon-rd Sep 6, 2022
c8b58be
Merge pull request #6 from szymon-rd/fix-search-elements
szymon-rd Sep 6, 2022
3deecb5
Add class for wide cover headers
szymon-rd Sep 6, 2022
b3cfa3f
Merge branch 'scaladoc-fixes' of github.com:szymon-rd/dotty into scal…
szymon-rd Sep 6, 2022
51b7d55
add missing index.md pages
Florian3k Sep 1, 2022
8b6ed58
fix gadts.md layout
Florian3k Sep 1, 2022
9307dc0
GitHub pages workflow
szymon-rd Aug 29, 2022
3550a6d
Group documentableItem elements & adjust event listener
szymon-rd Sep 7, 2022
c53a6ba
Merge branch 'scaladoc-fixes' of github.com:szymon-rd/dotty into scal…
szymon-rd Sep 7, 2022
451db6c
fix nested html tags
Florian3k Sep 8, 2022
f9e4e84
Moved Members header
szymon-rd Sep 8, 2022
38184ec
Attributes only in full member page
szymon-rd Sep 8, 2022
a60ef52
Merge pull request #7 from szymon-rd/fix-nested-html-tags
Florian3k Sep 8, 2022
5fa080b
fix search packages
Florian3k Sep 9, 2022
e725348
Merge pull request #8 from szymon-rd/fix-search-packages
Florian3k Sep 9, 2022
81cc947
ToC in API docs
szymon-rd Sep 12, 2022
06c5c82
Fix links in header
szymon-rd Sep 12, 2022
491720e
Add second line with description to search result
Florian3k Sep 14, 2022
56e925e
Merge pull request #10 from szymon-rd/search-result-description
Florian3k Sep 14, 2022
c7b0991
Fixed hidden docs
szymon-rd Sep 15, 2022
ac76cae
Added non-breaking space in search results
szymon-rd Sep 15, 2022
1874d23
2nd part of layout fixes
kamilszewczyk0 Sep 16, 2022
181c515
Merge pull request #12 from szymon-rd/scaladoc-fixes-part2
kamilszewczyk0 Sep 16, 2022
3732466
Fix recent searches:
szymon-rd Sep 16, 2022
378a478
current page link click no reload
Florian3k Sep 19, 2022
f49cb04
Merge pull request #13 from szymon-rd/current-page-inactive-link
Florian3k Sep 19, 2022
c0657c3
Next part of layout fixes
kamilszewczyk0 Sep 20, 2022
90bc725
Merge pull request #14 from szymon-rd/scaladoc-fixes-part3
kamilszewczyk0 Sep 20, 2022
0805398
Add dynamic page reload
Florian3k Sep 20, 2022
005f66f
fix reloading
Florian3k Sep 20, 2022
cf21401
basic styles for table
kamilszewczyk0 Sep 22, 2022
4559aa4
always render toc
Florian3k Sep 22, 2022
8145775
fix js
Florian3k Sep 22, 2022
ddd37f3
remove obsolete scripts and styles
Florian3k Sep 22, 2022
ed1f15d
disconnect observer
Florian3k Sep 22, 2022
9eb4926
remove obsolete logo js
Florian3k Sep 22, 2022
0f3083c
move js out of function
Florian3k Sep 22, 2022
b89d511
Merge pull request #16 from szymon-rd/always-render-toc
kamilszewczyk0 Sep 22, 2022
16c7a4b
render toc only in docs
Florian3k Sep 22, 2022
7994b8f
Merge pull request #17 from szymon-rd/always-render-toc
Florian3k Sep 22, 2022
18189ee
fixed scrollbar thumb background on hover
kamilszewczyk0 Sep 22, 2022
26f7b94
Do not render empty member list
Florian3k Sep 22, 2022
537c68a
fix document.title setting
Florian3k Sep 23, 2022
2489f1c
fix highlight
Florian3k Sep 23, 2022
1be314d
Merge branch 'scaladoc-fixes' into dynamic-page-reload
Florian3k Sep 23, 2022
ad0b88e
Merge pull request #15 from szymon-rd/dynamic-page-reload
Florian3k Sep 23, 2022
2e488cf
changed color palette and left nav stays after click
kamilszewczyk0 Sep 25, 2022
f5521c8
fixed rwd
kamilszewczyk0 Sep 25, 2022
d8786c1
Merge branch 'scaladoc-fixes' into scaladoc-fixes-part3
kamilszewczyk0 Sep 25, 2022
7883710
Merge branch 'scaladoc-fixes' into scaladoc-fixes-part3 pt 2
kamilszewczyk0 Sep 25, 2022
cce944d
Merge pull request #19 from szymon-rd/scaladoc-fixes-part3
kamilszewczyk0 Sep 25, 2022
1425358
ux fixes
kamilszewczyk0 Sep 25, 2022
2bd9bca
Revert "ux fixes"
Florian3k Sep 26, 2022
29e3639
fix merge
Florian3k Sep 26, 2022
f545c43
Merge pull request #20 from szymon-rd/fix-merge
Florian3k Sep 26, 2022
18ce27f
Revert "Render TOC only in docs"
szymon-rd Sep 26, 2022
f0236af
remove useless old styles
Florian3k Sep 26, 2022
f1f4001
fix TOC links
Florian3k Sep 26, 2022
c716047
adjust header classes in rendered markdown
Florian3k Sep 26, 2022
94988e4
Merge pull request #23 from szymon-rd/revert-17-always-render-toc
szymon-rd Sep 26, 2022
548fa84
Merge pull request #22 from szymon-rd/misc-scaladoc-fixes
szymon-rd Sep 26, 2022
f6286f0
Merge pull request #9 from szymon-rd/scaladoc-toc-in-api
szymon-rd Sep 26, 2022
25eff3c
ToC sticky
kamilszewczyk0 Sep 27, 2022
a2ae349
fix dynamic loading
Florian3k Sep 29, 2022
6a603ad
Merge branch 'scaladoc-fixes' into omit-rendering-empty-members
Florian3k Sep 29, 2022
c8afef1
Merge pull request #18 from szymon-rd/omit-rendering-empty-members
Florian3k Sep 29, 2022
aa4ad38
fix contributors
Florian3k Oct 3, 2022
15ff3ea
implementing ux changes and fixes
kamilszewczyk0 Oct 5, 2022
1df646f
Merge pull request #25 from szymon-rd/scaladoc-fixes-ux-fixes
kamilszewczyk0 Oct 5, 2022
d933e8f
Changing design for members
kamilszewczyk0 Oct 9, 2022
8c28994
Another changes for members
kamilszewczyk0 Oct 9, 2022
2c4bfee
Merge pull request #26 from szymon-rd/member-design
kamilszewczyk0 Oct 9, 2022
fc4241e
Merge branch 'scaladoc-fixes' into dynamic-loading-fixes
Florian3k Oct 10, 2022
ccfc44d
Merge pull request #24 from szymon-rd/dynamic-loading-fixes
szymon-rd Oct 10, 2022
bcdad27
Unique sections in ScalaDoc ToC
szymon-rd Oct 10, 2022
73f9d97
Merge branch 'scaladoc-fixes' of github.com:szymon-rd/dotty into scal…
szymon-rd Oct 10, 2022
189794b
changed colors and color tokens
kamilszewczyk0 Oct 11, 2022
f99aa83
Merge pull request #27 from szymon-rd/changing-color-tokens
kamilszewczyk0 Oct 11, 2022
eb9832c
Changed structure of members list
szymon-rd Oct 11, 2022
622bade
Merge branch 'scaladoc-fixes' of github.com:szymon-rd/dotty into scal…
szymon-rd Oct 11, 2022
7018322
event lister for extending members section fixed
kamilszewczyk0 Oct 12, 2022
ff158f0
Split attrbutes to Value Parameters, Type Parameters and Attributs
szymon-rd Oct 12, 2022
189da2f
Fix ToC and Members List
szymon-rd Oct 12, 2022
b4e65bd
Remove Contributors, fix styles in API docs
szymon-rd Oct 12, 2022
1760e18
Added show/collapse
szymon-rd Oct 12, 2022
057ec7b
fix pathToRoot attr
Florian3k Oct 13, 2022
71a0082
Fix not closing search view on click under it
szymon-rd Oct 13, 2022
a538125
ToC nesting levels
szymon-rd Oct 13, 2022
0877df2
Fix styles in supertypes/subtypes
szymon-rd Oct 13, 2022
760285d
fix clearing filters and filter search optimalization
kamilszewczyk0 Oct 18, 2022
d3c9e8e
Merge pull request #29 from szymon-rd/filters-rebuild
kamilszewczyk0 Oct 18, 2022
9d90892
styles corections according to designer specification
kamilszewczyk0 Oct 19, 2022
532e42c
Merge pull request #30 from szymon-rd/style-fixes
kamilszewczyk0 Oct 19, 2022
603a596
styling only fixes (code snippets, links, headers)
jdudrak Oct 19, 2022
71f8528
minor styles changes:
jdudrak Oct 20, 2022
3a942ff
Icons update + Minor style changes.
jdudrak Oct 20, 2022
8b09349
fixing arrow icons on members
kamilszewczyk0 Oct 20, 2022
6b53e3d
fixed styles for members
kamilszewczyk0 Oct 21, 2022
326a86a
Merge pull request #31 from szymon-rd/style-fixes
kamilszewczyk0 Oct 21, 2022
52947b4
Fixed expand buttons and listeners
kamilszewczyk0 Oct 24, 2022
ff7a5e2
Merge pull request #32 from szymon-rd/arrow-rotation-fix
kamilszewczyk0 Oct 24, 2022
b03b9a4
Merge pull request #28 from szymon-rd/dynamic-loading-fixes
szymon-rd Oct 26, 2022
15879c9
API members styles refinement
jdudrak Oct 27, 2022
19d0a51
fixed toggling sidebar on mobile
kamilszewczyk0 Oct 27, 2022
2bbfd48
Put Scala first and expand it
szymon-rd Oct 27, 2022
ef0a6f9
Lightmode colors refinement
jdudrak Oct 27, 2022
6c73d2b
Layout Fixes
jdudrak Oct 28, 2022
0bdd1d7
implementing counign for displayed members
kamilszewczyk0 Oct 30, 2022
ead2ffc
add no result page to members filters
kamilszewczyk0 Oct 31, 2022
e9520d1
created styles and structure for "no results" page
kamilszewczyk0 Oct 26, 2022
5713a9c
Put no results in search
szymon-rd Oct 26, 2022
c986fc5
fixed navbar layout
kamilszewczyk0 Oct 27, 2022
c181b41
fixed paddings for no result page in searchbar
kamilszewczyk0 Oct 30, 2022
520b10e
adding comment wioth instruction to fix
kamilszewczyk0 Oct 31, 2022
3c6ebd3
No results icon & dispatch event on clear
szymon-rd Oct 31, 2022
a466d82
Merge pull request #33 from szymon-rd/no-result-page
szymon-rd Oct 31, 2022
d62fdf8
clear button invisible if no filters applied
kamilszewczyk0 Oct 31, 2022
95c242c
searchbar z-index increased
kamilszewczyk0 Nov 1, 2022
3c2916d
removed errors when there is no filters
kamilszewczyk0 Nov 1, 2022
55b2cb2
dynamic scroll-margin-top
kamilszewczyk0 Nov 1, 2022
bf8eba8
Merge pull request #34 from szymon-rd/members-area-fixes
kamilszewczyk0 Nov 1, 2022
08b608a
removed console.logs
kamilszewczyk0 Nov 1, 2022
c4191e1
fix for searchbar z-index and dynamic scrollMarginTop
kamilszewczyk0 Nov 2, 2022
98bead0
Fix resources
szymon-rd Nov 2, 2022
87803db
adding layout and ux fixes
kamilszewczyk0 Nov 3, 2022
1a11cfd
Merge branch 'scaladoc-fixes' into ux-fixes
kamilszewczyk0 Nov 3, 2022
2b6cc6a
Merge pull request #35 from szymon-rd/ux-fixes
kamilszewczyk0 Nov 3, 2022
91bc607
added z-index to navbar
kamilszewczyk0 Nov 7, 2022
aa47214
Merge remote-tracking branch 'upstream/language-reference-stable' int…
szymon-rd Nov 9, 2022
6501bb4
Fix building documentation source versions
szymon-rd Nov 9, 2022
3990551
Revert "Fixed hidden docs"
szymon-rd Nov 15, 2022
0712ad9
Hide back more details doc and don't show them in the Next
szymon-rd Nov 15, 2022
24e5f45
Use commas instead of with
szymon-rd Nov 16, 2022
05fb271
Fix “nightly warning”
julienrf Oct 21, 2022
59a355e
fixed mobile menu z-index
kamilszewczyk0 Nov 19, 2022
ba2591f
scrolled toc on horizontal devices
kamilszewczyk0 Nov 19, 2022
cea9d1d
fixed bug with left sidemenu closing on picking category
kamilszewczyk0 Nov 19, 2022
5ede5bc
Merge pull request #36 from szymon-rd/iteration-fixes
kamilszewczyk0 Nov 19, 2022
bca0b44
Remove graph from member details
szymon-rd Nov 22, 2022
0c361cf
Split type signatures into two separate spans (short and long)
szymon-rd Nov 23, 2022
4893f43
removed button from top headers in members area
kamilszewczyk0 Nov 27, 2022
d8b6fcf
created banners and added correct icons to resources
kamilszewczyk0 Nov 27, 2022
391fb4b
created indentation in main signatures
kamilszewczyk0 Nov 27, 2022
08badd0
TODO - tables layout on mobile
kamilszewczyk0 Nov 27, 2022
5289b69
Merge pull request #37 from szymon-rd/iteration-fixes
kamilszewczyk0 Nov 27, 2022
1ed3984
fixed icon for member expanding on hover
kamilszewczyk0 Nov 28, 2022
13536bc
mkae long headers break thw ord on smaller resolutions
kamilszewczyk0 Nov 29, 2022
ee12780
make member headers shorter when member is not open
kamilszewczyk0 Nov 29, 2022
f74dbae
Merge pull request #38 from szymon-rd/member-headers
kamilszewczyk0 Nov 29, 2022
0f94818
fixes fro expandable headers in type members
kamilszewczyk0 Nov 29, 2022
2f94c28
removed doubled piece of code
kamilszewczyk0 Nov 30, 2022
6261d39
updated view for tables on medium and small resolutions
kamilszewczyk0 Nov 30, 2022
27fe46f
Add support for experimental (separate section)
szymon-rd Nov 30, 2022
ba8401d
Revert .github changes
szymon-rd Dec 6, 2022
2271522
Fix grouped members disappearing entire website
szymon-rd Dec 6, 2022
7e63704
Use more precise explanation for opaque transparency
kubukoz Dec 8, 2022
29639f9
Use more precise explanation for opaque transparency (#16480)
WojciechMazur Dec 9, 2022
8877ef2
Fix no results component
szymon-rd Dec 9, 2022
e27c7f9
Fix tests for ScalaDoc (with -> ,)
szymon-rd Dec 9, 2022
8772756
New scaladoc version (#16310)
szymon-rd Dec 9, 2022
62a466c
Merge branch 'main' into language-reference-stable
szymon-rd Dec 12, 2022
7106fc9
Allow PRs for GH actions bot
szymon-rd Dec 12, 2022
80b2841
Not ignore language reference stable branch on CI
szymon-rd Dec 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ name: Dotty

on:
push:
branches-ignore:
- 'language-reference-stable'
tags:
- '**'
pull_request:
branches-ignore:
- 'language-reference-stable'
schedule:
- cron: '0 3 * * *' # Every day at 3 AM
workflow_dispatch:
Expand Down Expand Up @@ -256,6 +252,7 @@ jobs:
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip community_build]')
&& !contains(github.event.pull_request.body, '[skip community_build_a]')
)
|| (
github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -303,6 +300,7 @@ jobs:
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip community_build]')
&& !contains(github.event.pull_request.body, '[skip community_build_b]')
)
|| (
github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -350,6 +348,7 @@ jobs:
github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip community_build]')
&& !contains(github.event.pull_request.body, '[skip community_build_c]')
)
|| (
github.event_name == 'workflow_dispatch'
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Scala CLA
on:
pull_request:
branches-ignore:
- 'language-reference-stable'
push:
branches:
- 'language-reference-backport'
- 'language-reference-stable'
permissions:
contents: write
pull-requests: write
Expand Down
44 changes: 20 additions & 24 deletions .github/workflows/language-reference.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: language-reference-documentation
name: Language reference documentation

on:
push:
Expand All @@ -14,14 +14,14 @@ permissions:

jobs:
build-and-push:
name: Build reference documentation and push it
permissions:
contents: write # for Git to git push
pull-requests: write # for peter-evans/create-pull-request to create a PR
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Git Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -67,26 +67,22 @@ jobs:
fi
cd ..

- name: Merge changes to main
if: github.event_name == 'push'
run: |
cd dotty
git fetch origin main:main
git checkout main
git config user.name gh-actions
git config user.email [email protected]
git merge language-reference-stable
cd ..

- name: Create pull request with backport to main
if: github.event_name == 'push'
uses: peter-evans/create-pull-request@v4
backport-to-main:
name: Create pull request with backport to main
permissions:
pull-requests: write # for repo-sync/pull-request to create a PR
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v3
- uses: repo-sync/pull-request@v2
with:
path: dotty
branch: language-reference-backport
labels: area:documentation
title: Backport changes from stable documentation branch
body: This pull request is created automatically after push to stable documentation branch and backports the changes
reviewers: pikinier20,julienrf
assignees: pikinier20
destination_branch: main
pr_label: area:documentation
pr_title: Sync with the stable documentation branch
pr_body: |
This pull request is syncing the main with changes from language-reference-stable.

It was created automatically after ${{ github.event.head_commit.id }} by @${{ github.event.head_commit.author.username }}
pr_assignee: ${{ github.event.head_commit.author.username }}

1 change: 1 addition & 0 deletions docs/_assets/css/frontpage.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ h1#main {
/* navigation */
header {
font-size: 24px;
margin-block-end: calc(2* var(--base-spacing));
}

header .nav-item i {
Expand Down
5 changes: 0 additions & 5 deletions docs/_assets/docsScalaLangResources/scaladoc-assets.html

This file was deleted.

4 changes: 4 additions & 0 deletions docs/_docs/contributing/procedures/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: index
title: Procedures
---
4 changes: 4 additions & 0 deletions docs/_docs/contributing/tools/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
layout: index
title: IDEs and Tools
---
47 changes: 26 additions & 21 deletions docs/_docs/internals/gadts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# GADTs - Broad overview
---
layout: doc-page
title: "GADTs - Broad overview"
---

## Introduction

There are multiple levels to the implementation. They deal with slightly different problems. The most important levels are the following ones:

Expand All @@ -18,9 +23,9 @@ There are also other parts to supporting GADTs. Roughly in order of importance,
1. Attachment key is named `inferredGadtConstraints`.
4. When we select members on a type that may have GADT constraints, we perform special "healing" by approximating the type using those constraints. We cannot take the constraints into account because member lookup is cached, and GADT constraints are only valid for specific scopes.

# Useful widgets
## Useful widgets

## Expr
### Expr

This is the classical GADT example:

Expand All @@ -36,7 +41,7 @@ enum Expr[T] {
}
```

## EQ
### EQ

The following enum will result in an equality constraint between `S` and `T` if we match on it:

Expand All @@ -46,7 +51,7 @@ enum EQ[S, T] {
}
```

## SUB
### SUB

The following enum will result in a subtyping constraint `S <: T` if we match on it:

Expand All @@ -56,9 +61,9 @@ enum SUB[-S, +T] {
}
```

# Details of above
## Details of above

## What abstract types can have GADT constraints
### What abstract types can have GADT constraints

Right now, we record GADT constraints for:

Expand All @@ -67,9 +72,9 @@ Right now, we record GADT constraints for:

There is a branch on the way which will also record them for type members (so path-dependent types) and singleton types. It has a paper associated: "Implementing path-depepdent GADTs for Scala 3".

## What are necessary relationships? Any examples?
### What are necessary relationships? Any examples?

### Covariance means no constraint is necessary
#### Covariance means no constraint is necessary

Standard (non-case) classes allow "strange" inheritance which means that we cannot infer any information from covariant type parameters.

Expand All @@ -90,7 +95,7 @@ class Weird(list: List[String]) extends IntList with Expr[Nothing]

Case classes have a special check which disallows inheritance like `Weird`. This means we can infer extra information from them.

## Breaking down the constraints
### Breaking down the constraints

```scala
class Expr[A]
Expand All @@ -113,9 +118,9 @@ def foo[T](e: Expr[List[T]]): T =
}
```

## Relation betweeen GadtConstraint and OrderingConstraint
### Relation betweeen GadtConstraint and OrderingConstraint

### Internal and external types
#### Internal and external types

GadtConstraint uses OrderingConstraint as the datastructure to record information about GADT constraints.

Expand All @@ -127,9 +132,9 @@ To solve this, GadtConstraint internally creates TypeParamRefs which it adds to

The TypeParamRefs and TypeVars registered in one constraint cannot ever be present in types mentioned in the other type constraint. The internal TypeParamRefs and TypeVars cannot ever leak out of the GadtConstraint. We cannot ever record a bound in GadtConstraint which mentions TypeParamRefs used for type inference. (That part is ensured by the way TypeComparer is organised &#x2013; we will always try to record bounds in the "normal" constraint before recording a GADT bound.)

# Other details
## Other details

## TypeComparer approximations
### TypeComparer approximations

TypeComparer sometimes approximates the types it compares. Let's see an example based on these definitions:

Expand All @@ -142,11 +147,11 @@ when comparing if `IntList <: Expr[Int]`, `TypeComparer` will approximate `IntLi

The variables which TypeComparer sets are `approxState` and `frozenGadt`.

## Necessary/sufficient either
### Necessary/sufficient either

TypeComparer sometimes needs to approximate some constraints, specifically when dealing with intersection and union types. The way this approximation works changes if we're currently inferring GADT constraints. This is hopefully documented well in TypeComparer in doc comments for `necessaryEither` and `sufficientEither`.

## Types bound in patterns
### Types bound in patterns

```scala
(list : List[Int]) match {
Expand All @@ -161,7 +166,7 @@ TypeComparer sometimes needs to approximate some constraints, specifically when
}
```

## Internal structure of OrderingConstraint
### Internal structure of OrderingConstraint

Imagine we have two type parameters in scope, `A` and `B`.

Expand All @@ -184,19 +189,19 @@ B <: A

The first two constraints are "entries" &#x2013; they are easy to look up whenever we ask for bounds of `A` or `B`. The third constraint is an ordering &#x2013; it helps with correctly propagating the bounds we record.

# Possible broad improvements
## Possible broad improvements

## Allow OrderingConstraint to record bounds for things other than TypeParamRefs
### Allow OrderingConstraint to record bounds for things other than TypeParamRefs

This would mean we no longer need to keep the bidirectional mapping in GadtConstraint.

## Not mixing OrderingConstraint and ConstraintHandling in GadtConstraint
### Not mixing OrderingConstraint and ConstraintHandling in GadtConstraint

GadtConstraint right now mixes OrderingConstraint and ConstraintHandling. The first one is supposed to be the immutable constraint datastructure. The second one implements mutable functionality around a variable containing the immutable datastructure.

GadtConstraint mixes them both. Things would be better organised if GadtConstraint was split like the normal constraint.

## Creating a separate TypeComparer for breaking down types into GADT constraints
### Creating a separate TypeComparer for breaking down types into GADT constraints

TypeComparer is biased towards one specific way of approximating constraints. When we infer types, it's ok to be "optimistic". When inferring GADT constraints, we should be as pessimistic as possible, in order to only infer constraints which are necessary.

Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/reference/contextual/derivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ Note the following properties of `Mirror` types,
+ The methods `ordinal` and `fromProduct` are defined in terms of `MirroredMonoType` which is the type of kind-`*`
which is obtained from `MirroredType` by wildcarding its type parameters.

### Implementing `derived` with `Mirror`
## Implementing `derived` with `Mirror`

As seen before, the signature and implementation of a `derived` method for a type class `TC[_]` are arbitrary, but we expect it to typically be of the following form:

Expand Down Expand Up @@ -484,7 +484,7 @@ The framework described here enables all three of these approaches without manda
For a brief discussion on how to use macros to write a type class `derived`
method please read more at [How to write a type class `derived` method using macros](./derivation-macro.md).

### Syntax
## Syntax

```
Template ::= InheritClauses [TemplateBody]
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/reference/other-new-features/opaques-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object o:

In this case we have inside the object (also for non-opaque types) that `o.T` is equal to
`T` or its expanded form `o.this.T`. Equality is understood here as mutual subtyping, i.e.
`o.T <: o.this.T` and `o.this.T <: T`. Furthermore, we have by the rules of opaque type aliases
`o.T <: o.this.T` and `o.this.T <: o.T`. Furthermore, we have by the rules of opaque type aliases
that `o.this.T` equals `R`. The two equalities compose. That is, inside `o`, it is
also known that `o.T` is equal to `R`. This means the following code type-checks:

Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/reference/other-new-features/opaques.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ val z = l2(3.1)
l1.mul(x, y) // type checks
l1.mul(x, z) // error: found l2.Logarithm, required l1.Logarithm
```
In general, one can think of an opaque type as being only transparent in the scope of `private[this]`.
In general, one can think of an opaque type as being only transparent in the scope of `private[this]` (unless the type is a top level definition - in this case, it's transparent only within the file it's defined in).

[More details](opaques-details.md)
4 changes: 1 addition & 3 deletions docs/_layouts/doc-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
<main>
<header>
{% if urls.editSource %}
<a class="text-button with-link body-small" href="{{ urls.editSource }}">
Edit this page on GitHub
</a>
<a class="text-button with-link body-small" href="{{ urls.editSource }}">Edit this page on GitHub</a>
{% endif %}
<h1 class="h600">{{ page.title }}</h1>
</header>
Expand Down
33 changes: 21 additions & 12 deletions docs/_layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
---
layout: static-site-main
---
<h1>{{ page.title }}</h1>

{{ content }}

<h2>Table of Contents</h2>
<ul class="table-of-contents">
{% for subpage in site.subpages %}
<li>
<a href="{{ subpage.url }}">{{ subpage.title }}</a>
</li>
{% endfor %}
</ul>

<main>
<header>
{% if urls.editSource %}
<!--<a class="text-button with-link body-small" href="{{ urls.editSource }}">Edit this page on GitHub</a>-->
{% endif %}
<h1 class="h600">{{ page.title }}</h1>
</header>

{{ content }}

<h2 class="h500">Table of Contents</h2>
<ul class="table-of-contents">
{% for subpage in site.subpages %}
<li>
<a href="{{ subpage.url }}">{{ subpage.title }}</a>
</li>
{% endfor %}
</ul>

</main>
4 changes: 0 additions & 4 deletions docs/_layouts/main.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
---
layout: base
extraJS:
- js/contributors.js
extraCSS:
- css/content-contributors.css
---

<div id="content-wrapper">{{ content }}</div>
Loading