-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
Adds :kind
and :kind!
commands to Eval Plugin
#345
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1428464
Implements `:kind!` GHCi command to Eval plugin
konn a53ae12
Adds golden tests for `:kind!`
konn 9767420
Removes redundant lines
konn 92ceb7a
Adds `:kind` command that returns kind only without normalisation
konn b9a59bf
Test cases for `:kind`
konn c4a3134
Fixes `Applies file LANGUAGE extensions` to avoid sufferring from Imp…
konn ee9fc0e
Removes redundant leading space
konn 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
This file contains 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
This file contains 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
This file contains 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,9 @@ | ||
{-# LANGUAGE DataKinds, TypeOperators #-} | ||
module T10 where | ||
import GHC.TypeNats ( type (+) ) | ||
|
||
type Dummy = 1 + 1 | ||
|
||
-- >>> type N = 1 | ||
-- >>> type M = 40 | ||
-- >>> :kind! N + M + 1 |
This file contains 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,11 @@ | ||
{-# LANGUAGE DataKinds, TypeOperators #-} | ||
module T10 where | ||
import GHC.TypeNats ( type (+) ) | ||
|
||
type Dummy = 1 + 1 | ||
|
||
-- >>> type N = 1 | ||
-- >>> type M = 40 | ||
-- >>> :kind! N + M + 1 | ||
-- N + M + 1 :: Nat | ||
-- = 42 |
This file contains 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 T11 where | ||
|
||
-- >>> :kind! a |
This file contains 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 T11 where | ||
|
||
-- >>> :kind! a | ||
-- Not in scope: type variable ‘a’ |
This file contains 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,9 @@ | ||
{-# LANGUAGE DataKinds, TypeOperators #-} | ||
module T12 where | ||
import GHC.TypeNats ( type (+) ) | ||
|
||
type Dummy = 1 + 1 | ||
|
||
-- >>> type N = 1 | ||
-- >>> type M = 40 | ||
-- >>> :kind N + M + 1 |
This file contains 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 @@ | ||
{-# LANGUAGE DataKinds, TypeOperators #-} | ||
module T12 where | ||
import GHC.TypeNats ( type (+) ) | ||
|
||
type Dummy = 1 + 1 | ||
|
||
-- >>> type N = 1 | ||
-- >>> type M = 40 | ||
-- >>> :kind N + M + 1 | ||
-- N + M + 1 :: Nat |
This file contains 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 T13 where | ||
|
||
-- >>> :kind a |
This file contains 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 T13 where | ||
|
||
-- >>> :kind a | ||
-- Not in scope: type variable ‘a’ |
This file contains 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
module T9 where | ||
import Data.Proxy | ||
import Data.Proxy (Proxy(..)) | ||
|
||
type P = Proxy | ||
|
||
-- >>> Proxy :: Proxy 3 |
This file contains 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{-# LANGUAGE DataKinds #-} | ||
module T9 where | ||
import Data.Proxy | ||
import Data.Proxy (Proxy(..)) | ||
|
||
type P = Proxy | ||
|
||
-- >>> Proxy :: Proxy 3 | ||
-- Proxy |
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 you let me know why have you changed this test? It seems irrelevant to me.
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.
Yes, that change is not directly related to my change; but without this hack, at least on my laptop,
Applies file LANGUAGE extensions
test case fails due to the interference with import lens.This issue seems already existent in the
master
branch and I wanted to avoid such errors to make my pull-request get merged as soon as possible. Indeed, I once wondered if I should make this change in this pull-request but I decided to include it since it's a minor change and somewhat related toEval
plugin.But, yes, this change is semantically separate from this pull-request. Should I file this workaround as another pull-request?
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.
I think it is worthwhile to post that as an issue, but for the separated PR, it's OK to stay this change as-is.