-
Notifications
You must be signed in to change notification settings - Fork 70
Add GHC-88333 #511
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
Open
MauScheff
wants to merge
5
commits into
haskellfoundation:main
Choose a base branch
from
MauScheff:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add GHC-88333 #511
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a16464f
Documented GHC-88333: Incorrect type variable on the LHS of infectivi…
MauScheff 8dbe4a8
Documented GHC-88333: Incorrect type variable on the LHS of infectivi…
MauScheff e40bb21
Merge branch 'main' of https://github.com/MauScheff/error-message-ind…
MauScheff 9cdea35
AST: Remove Assert from GHC
MauScheff 95f752b
Merge branch 'main' of https://github.com/haskellfoundation/error-mes…
MauScheff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...s/GHC-88333/incorrect-type-var-injectivity-condition-associated-type-family/after/Test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{-# LANGUAGE PolyKinds #-} | ||
{-# LANGUAGE TypeFamilyDependencies #-} | ||
|
||
module IncorrectTypeVarLHSInjectivityCondition where | ||
|
||
class Fcl a where | ||
type Ft a = r | r -> a |
4 changes: 4 additions & 0 deletions
4
.../GHC-88333/incorrect-type-var-injectivity-condition-associated-type-family/before/Test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module IncorrectTypeVarLHSInjectivityCondition where | ||
|
||
class Fcl a where | ||
type Ft a = r | a -> a |
5 changes: 5 additions & 0 deletions
5
...-88333/incorrect-type-var-injectivity-condition-associated-type-family/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Incorrect type variable on the LHS of injectivity condition | ||
--- | ||
|
||
In the example, the associated type family Ft is defined with an incorrect injectivity annotation. The left-hand side (LHS) of the injectivity condition should be the output type variable (r), but in the definition, it is the input type variable (a). This is what the error message is referring to. |
7 changes: 7 additions & 0 deletions
7
...ssages/GHC-88333/incorrect-type-var-injectivity-condition-type-family-where/after/Test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{-# LANGUAGE PolyKinds #-} | ||
{-# LANGUAGE TypeFamilyDependencies #-} | ||
|
||
module IncorrectTypeVarLHSInjectivityCondition where | ||
|
||
type family Fc a = r | r -> a where | ||
Fc a = a |
4 changes: 4 additions & 0 deletions
4
...sages/GHC-88333/incorrect-type-var-injectivity-condition-type-family-where/before/Test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module IncorrectTypeVarLHSInjectivityCondition where | ||
|
||
type family Fc a = r | a -> a where | ||
Fc a = a |
5 changes: 5 additions & 0 deletions
5
...s/GHC-88333/incorrect-type-var-injectivity-condition-type-family-where/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Incorrect type variable on the LHS of injectivity condition | ||
--- | ||
|
||
In the example, type family Fc is defined with an incorrect injectivity annotation. The left-hand side (LHS) of the injectivity condition should be the output type variable (r), but in the definition, it is the input type variable (a). This is what the error message is referring to. |
6 changes: 6 additions & 0 deletions
6
...dex/messages/GHC-88333/incorrect-type-var-injectivity-condition-type-family/after/Test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{-# LANGUAGE PolyKinds #-} | ||
{-# LANGUAGE TypeFamilyDependencies #-} | ||
|
||
module IncorrectTypeVarLHSInjectivityCondition where | ||
|
||
type family F a = r | r -> a |
3 changes: 3 additions & 0 deletions
3
...ex/messages/GHC-88333/incorrect-type-var-injectivity-condition-type-family/before/Test.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module IncorrectTypeVarLHSInjectivityCondition where | ||
|
||
type family F a = r | a -> a |
5 changes: 5 additions & 0 deletions
5
...essages/GHC-88333/incorrect-type-var-injectivity-condition-type-family/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Incorrect type variable on the LHS of injectivity condition | ||
--- | ||
|
||
In the example, type family F is defined with an incorrect injectivity annotation. The left-hand side (LHS) of the injectivity condition should be the output type variable (r), but in the definition, it is the input type variable (a). This is what the error message is referring to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: Incorrect type variable on the LHS of injectivity condition | ||
summary: Injectivity annotations are used to constrain type families, so that for a given input type, there is exactly one output type. | ||
severity: error | ||
introduced: 9.6.1 | ||
--- | ||
|
||
This error is about the incorrect use of type variables in the injectivity condition of type families. | ||
|
||
Type families in Haskell are a way to define type-level functions. An injectivity annotation (| a -> r) is used to specify that for a given input type a, there is exactly one output type r that the type family can map to. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we please use Markdown backticks here and elsewhere?