Commit a5d48548 authored by Andrew Gibiansky's avatar Andrew Gibiansky

travis 12

parent 54340af9
......@@ -55,9 +55,11 @@ install:
- stack setup --resolver=$RESOLVER
- stack build --dependencies-only --resolver=$RESOLVER
# For verify_formatting.py
- if $FORMATTING; then stack install hindent; fi
script:
- export LD_LIBRARY_PATH=$HOME/zeromq/lib
- stack build --resolver=$RESOLVER
- stack test --resolver=$RESOLVER
- if $FORMATTING; then ./verify_formatting.py; fi
- |
......
......@@ -30,6 +30,7 @@ import Data.List (findIndex, and, foldl1, nubBy)
import Text.Printf
import Data.Char as Char
import Data.Dynamic
import Data.Typeable.Internal
import Data.Typeable
import qualified Data.Serialize as Serialize
import System.Directory
......@@ -356,11 +357,18 @@ evaluate kernelState code output widgetHandler = do
-- | Compile a string and extract a value from it. Effectively extract the result of an expression
-- from inside the notebook environment.
extractValue :: Typeable a => String -> Interpreter a
extractValue expr = do
compiled <- dynCompileExpr expr
case fromDynamic compiled of
Nothing -> error "Error casting types in Evaluate.hs"
Just result -> return result
extractValue expr = result
where
result = do
compiled <- dynCompileExpr expr
case fromDynamic compiled of
Nothing -> error $
"Error casting types in Evaluate.hs: " ++
showRep (dynTypeRep compiled) ++
" -> " ++
showRep (typeRep result)
Just result -> return result
showRep rep = show $ map (tyConPackage .typeRepTyCon) $ concatMap typeRepArgs (typeRepArgs rep)
flushWidgetMessages :: KernelState
-> [WidgetMsg]
......
......@@ -4,5 +4,3 @@ packages:
- './ipython-kernel'
- './ghc-parser'
resolver: lts-6.2
extra-deps:
- system-argv0-0.1.1 # Necessary for LTS 2.22 (GHC 7.8)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment