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
6b6a9b89
Commit
6b6a9b89
authored
Mar 04, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing unshowable displays, adding pager docs
parent
b2dfd0e4
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
406 additions
and
62 deletions
+406
-62
IHaskell.ipynb
notebooks/IHaskell.ipynb
+398
-55
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+8
-7
No files found.
notebooks/IHaskell.ipynb
View file @
6b6a9b89
This diff is collapsed.
Click to expand it.
src/IHaskell/Eval/Evaluate.hs
View file @
6b6a9b89
...
...
@@ -649,10 +649,11 @@ evalCommand _ (Directive GetHelp _) state = do
,
"Any prefix of the commands will also suffice, e.g. use :ty for :type."
,
""
,
"Options:"
,
" lint - enable or disable linting."
,
" svg - use svg output (cannot be resized)."
,
" show-types - show types of all bound names"
,
" show-errors - display Show instance missing errors normally."
,
" lint – enable or disable linting."
,
" svg – use svg output (cannot be resized)."
,
" show-types – show types of all bound names"
,
" show-errors – display Show instance missing errors normally."
,
" pager – use the pager to display results of :info, :doc, :hoogle, etc."
]
-- This is taken largely from GHCi's info section in InteractiveUI.
...
...
@@ -801,9 +802,9 @@ evalCommand output (Expression expr) state = do
isShowError
(
ManyDisplay
_
)
=
False
isShowError
(
Display
errs
)
=
-- Note that we rely on this error message being 'type cleaned', so
-- that `Show` is not displayed as GHC.Show.Show.
-- that `Show` is not displayed as GHC.Show.Show.
This is also very fragile!
startswith
"No instance for (Show"
msg
&&
isInfixOf
"
arising from a use of `print'
"
msg
isInfixOf
"
print it
"
msg
where
msg
=
extractPlain
errs
isSvg
(
DisplayData
mime
_
)
=
mime
==
MimeSvg
...
...
@@ -879,7 +880,7 @@ evalCommand output (Expression expr) state = do
postprocess
(
DisplayData
MimeHtml
_
)
=
html
$
printf
fmt
unshowableType
(
formatErrorWithClass
"err-msg collapse"
text
)
script
where
fmt
=
"<div class='collapse-group'><span class='btn' href='#' id='unshowable'>Unshowable:<span class='show-type'>%s</span></span>%s</div><script>%s</script>"
fmt
=
"<div class='collapse-group'><span class='btn
btn-default
' href='#' id='unshowable'>Unshowable:<span class='show-type'>%s</span></span>%s</div><script>%s</script>"
script
=
unlines
[
"$('#unshowable').on('click', function(e) {"
,
" e.preventDefault();"
,
...
...
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