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
1e18f31b
Commit
1e18f31b
authored
May 27, 2015
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing formatting issues, again
parent
6df3ee72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
Evaluate.hs
src/IHaskell/Eval/Evaluate.hs
+24
-21
No files found.
src/IHaskell/Eval/Evaluate.hs
View file @
1e18f31b
...
...
@@ -339,35 +339,38 @@ evaluate kernelState code output = do
storeItCommand
execCount
=
Statement
$
printf
"let it%d = it"
execCount
extractValue
::
forall
a
.
Typeable
a
=>
String
->
Interpreter
a
extractValue
::
Typeable
a
=>
String
->
Interpreter
a
extractValue
expr
=
do
compiled
<-
dynCompileExpr
expr
case
fromDynamic
compiled
of
Nothing
->
let
expectedTypeRep
=
typeOf
(
undefined
::
a
)
actualTypeRep
=
dynTypeRep
compiled
TypeRep
fing1
tycon1
subs1
=
expectedTypeRep
TypeRep
fing2
tycon2
subs2
=
actualTypeRep
in
error
$
concat
[
"Expecting value of type "
,
showTypeRep
expectedTypeRep
,
" but got value of type "
,
showTypeRep
actualTypeRep
]
Nothing
->
error
"Error casting types in Evaluate.hs"
Just
result
->
return
result
showTypeRep
::
TypeRep
->
String
showTypeRep
(
TypeRep
fingerprint
tycon
subs
)
=
concat
[
"TypeRep "
,
show
fingerprint
,
" "
,
show
(
tyConPackage
tycon
,
tyConModule
tycon
,
tyConName
tycon
,
tyConHash
tycon
)
,
" "
,
"["
,
intercalate
", "
(
map
showTypeRep
subs
)
,
"]"
]
concat
[
"TypeRep "
,
show
fingerprint
,
" "
,
show
(
tyConPackage
tycon
,
tyConModule
tycon
,
tyConName
tycon
,
tyConHash
tycon
)
,
" "
,
"["
,
intercalate
", "
(
map
showTypeRep
subs
)
,
"]"
]
{-
let expectedTypeRep = typeOf (undefined :: a)
actualTypeRep = dynTypeRep compiled
TypeRep fing1 tycon1 subs1 = expectedTypeRep
TypeRep fing2 tycon2 subs2 = actualTypeRep
in error $ concat
[ "Expecting value of type "
, showTypeRep expectedTypeRep
, " but got value of type "
, showTypeRep actualTypeRep
]
-}
safely
::
KernelState
->
Interpreter
EvalOut
->
Interpreter
EvalOut
safely
state
=
ghandle
handler
.
ghandle
sourceErrorHandler
where
...
...
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