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
4a123f0f
Commit
4a123f0f
authored
Dec 30, 2013
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added demo notebook
parent
46797e1c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
731 additions
and
744 deletions
+731
-744
Haskell-Notebook.ipynb
Haskell-Notebook.ipynb
+0
-734
IHaskell.ipynb
IHaskell.ipynb
+710
-0
Evaluate.hs
IHaskell/Eval/Evaluate.hs
+8
-4
Lint.hs
IHaskell/Eval/Lint.hs
+6
-2
profile.tar
profile/profile.tar
+0
-0
custom.js
profile/static/custom/custom.js
+7
-4
No files found.
Haskell-Notebook.ipynb
deleted
100644 → 0
View file @
46797e1c
This diff is collapsed.
Click to expand it.
IHaskell.ipynb
0 → 100644
View file @
4a123f0f
This diff is collapsed.
Click to expand it.
IHaskell/Eval/Evaluate.hs
View file @
4a123f0f
...
...
@@ -69,7 +69,7 @@ typeCleaner = useStringType . foldl' (.) id (map (`replace` "") fullPrefixes)
useStringType
=
replace
"[Char]"
"String"
write
::
GhcMonad
m
=>
String
->
m
()
write
x
=
when
debug
$
liftIO
$
hPutStrLn
stderr
x
write
x
=
when
debug
$
liftIO
$
hPutStrLn
stderr
$
"DEBUG: "
++
x
type
Interpreter
=
Ghc
...
...
@@ -466,8 +466,10 @@ evalCommand output (Expression expr) state = do
-- implement the Show typeclass.
isShowError
errs
=
case
find
isPlain
errs
of
Just
(
Display
PlainText
msg
)
->
startswith
"No instance for (GHC.Show.Show"
msg
&&
isInfixOf
" arising from a use of `System.IO.print'"
msg
-- Note that we rely on this error message being 'type cleaned', so
-- that `Show` is not displayed as GHC.Show.Show.
startswith
"No instance for (Show"
msg
&&
isInfixOf
" arising from a use of `print'"
msg
Nothing
->
False
where
isPlain
(
Display
mime
_
)
=
mime
==
PlainText
...
...
@@ -479,7 +481,9 @@ evalCommand output (Expression expr) state = do
-- attempting to do this without the serialization to binary and
-- back gives very strange errors - all the types match but it
-- refuses to decode back into a [DisplayData].
runStmt
displayExpr
RunToCompletion
-- Suppress output, so as not to mess up console.
capturedStatement
(
const
$
return
()
)
displayExpr
displayedBytestring
<-
dynCompileExpr
"IHaskell.Display.serializeDisplay it"
case
fromDynamic
displayedBytestring
of
Nothing
->
error
"Expecting lazy Bytestring"
...
...
IHaskell/Eval/Lint.hs
View file @
4a123f0f
...
...
@@ -80,10 +80,11 @@ htmlSuggestions suggests = table (concatMap toHtml suggests)
++
row
(
el
(
style
severityClass
"Found:"
++
style
"code"
(
found
suggest
))
-- Things that look like this get highlighted.
styleId
"highlight-code"
"haskell"
(
found
suggest
))
++
el
(
style
severityClass
"Why Not:"
++
style
"code
"
(
whyNot
suggest
)))
style
Id
"highlight-code"
"haskell
"
(
whyNot
suggest
)))
where
severityClass
=
case
severity
suggest
of
LintWarning
->
"warning"
...
...
@@ -91,6 +92,9 @@ htmlSuggestions suggests = table (concatMap toHtml suggests)
style
::
String
->
String
->
String
style
cls
thing
=
[
i
|
<div class="suggestion-${cls}">${thing}</div>
|]
styleId
::
String
->
String
->
String
->
String
styleId
cls
id
thing
=
[
i
|
<div class="${cls}" id="${id}">${thing}</div>
|]
table
::
String
->
String
table
thing
=
[
i
|
<table class="suggestion-table">${thing}</table>
|]
...
...
profile/profile.tar
View file @
4a123f0f
No preview for this file type
profile/static/custom/custom.js
View file @
4a123f0f
...
...
@@ -81,22 +81,25 @@ $([IPython.events]).on('app_initialized.NotebookApp', function(){
IPython
.
CodeCell
.
options_default
[
'cm_config'
][
'mode'
]
=
'haskell'
;
});
var
highlight
Hlint
=
function
()
{
var
highlight
Codes
=
function
()
{
// Add logic here that should be run once per reply.
$
(
'.
suggestion
-code'
).
each
(
function
()
{
$
(
'.
highlight
-code'
).
each
(
function
()
{
var
$this
=
$
(
this
),
$code
=
$this
.
html
(),
$unescaped
=
$
(
'<div/>'
).
html
(
$code
).
text
();
$this
.
empty
();
// Never highlight this block again.
this
.
className
=
""
;
CodeMirror
(
this
,
{
value
:
$unescaped
,
mode
:
'haskell'
,
mode
:
this
.
id
,
lineNumbers
:
false
,
readOnly
:
true
});
});
};
$
([
IPython
.
events
]).
on
(
'shell_reply.Kernel'
,
highlight
Hlint
);
$
([
IPython
.
events
]).
on
(
'shell_reply.Kernel'
,
highlight
Codes
);
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