Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
486fc9f4
Commit
486fc9f4
authored
Jul 07, 2021
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support :kind!
parent
d929dfac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+9
-0
Parser.hs
src/IHaskell/Eval/Parser.hs
+2
-0
No files found.
src/IHaskell/Eval/Evaluate.hs
View file @
486fc9f4
...
@@ -677,6 +677,15 @@ evalCommand _ (Directive GetKind expr) state = wrapExecution state $ do
...
@@ -677,6 +677,15 @@ evalCommand _ (Directive GetKind expr) state = wrapExecution state $ do
let
typeStr
=
showSDocUnqual
flags
$
ppr
kind
let
typeStr
=
showSDocUnqual
flags
$
ppr
kind
return
$
formatType
$
expr
++
" :: "
++
typeStr
return
$
formatType
$
expr
++
" :: "
++
typeStr
evalCommand
_
(
Directive
GetKindBang
expr
)
state
=
wrapExecution
state
$
do
write
state
$
"Kind!: "
++
expr
(
typ
,
kind
)
<-
GHC
.
typeKind
True
expr
flags
<-
getSessionDynFlags
let
kindStr
=
text
expr
<+>
dcolon
<+>
ppr
kind
let
typeStr
=
equals
<+>
ppr
typ
let
finalStr
=
showSDocUnqual
flags
$
vcat
[
kindStr
,
typeStr
]
return
$
formatType
finalStr
evalCommand
_
(
Directive
LoadFile
names
)
state
=
wrapExecution
state
$
do
evalCommand
_
(
Directive
LoadFile
names
)
state
=
wrapExecution
state
$
do
write
state
$
"Load: "
++
names
write
state
$
"Load: "
++
names
...
...
src/IHaskell/Eval/Parser.hs
View file @
486fc9f4
...
@@ -62,6 +62,7 @@ data DirectiveType = GetType -- ^ Get the type of an expression via ':type'
...
@@ -62,6 +62,7 @@ data DirectiveType = GetType -- ^ Get the type of an expression via ':type'
|
SearchHoogle
-- ^ Search for something via Hoogle.
|
SearchHoogle
-- ^ Search for something via Hoogle.
|
GetDoc
-- ^ Get documentation for an identifier via Hoogle.
|
GetDoc
-- ^ Get documentation for an identifier via Hoogle.
|
GetKind
-- ^ Get the kind of a type via ':kind'.
|
GetKind
-- ^ Get the kind of a type via ':kind'.
|
GetKindBang
-- ^ Get the kind and normalised type via ':kind!'.
|
LoadModule
-- ^ Load and unload modules via ':module'.
|
LoadModule
-- ^ Load and unload modules via ':module'.
|
SPrint
-- ^ Print without evaluating via ':sprint'.
|
SPrint
-- ^ Print without evaluating via ':sprint'.
deriving
(
Show
,
Eq
)
deriving
(
Show
,
Eq
)
...
@@ -277,6 +278,7 @@ parseDirective (':':directive) ln =
...
@@ -277,6 +278,7 @@ parseDirective (':':directive) ln =
[
(
LoadModule
,
"module"
)
[
(
LoadModule
,
"module"
)
,
(
GetType
,
"type"
)
,
(
GetType
,
"type"
)
,
(
GetKind
,
"kind"
)
,
(
GetKind
,
"kind"
)
,
(
GetKindBang
,
"kind!"
)
,
(
GetInfo
,
"info"
)
,
(
GetInfo
,
"info"
)
,
(
SearchHoogle
,
"hoogle"
)
,
(
SearchHoogle
,
"hoogle"
)
,
(
GetDoc
,
"documentation"
)
,
(
GetDoc
,
"documentation"
)
...
...
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