Commit e75e4463 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Remove debugging code (the Typeable printer)

parent 1e18f31b
{-# LANGUAGE NoImplicitPrelude, DoAndIfThenElse, NoOverloadedStrings, TypeSynonymInstances, GADTs, CPP #-} {-# LANGUAGE NoImplicitPrelude, DoAndIfThenElse, NoOverloadedStrings, TypeSynonymInstances, GADTs, CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}
{- | Description : Wrapper around GHC API, exposing a single `evaluate` interface that runs {- | Description : Wrapper around GHC API, exposing a single `evaluate` interface that runs
a statement, declaration, import, or directive. a statement, declaration, import, or directive.
...@@ -23,7 +22,6 @@ import qualified Data.ByteString as BS ...@@ -23,7 +22,6 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS import qualified Data.ByteString.Lazy as LBS
import qualified Data.ByteString.Char8 as CBS import qualified Data.ByteString.Char8 as CBS
import Data.Typeable.Internal
import Control.Concurrent (forkIO, threadDelay) import Control.Concurrent (forkIO, threadDelay)
import Prelude (putChar, head, tail, last, init, (!!)) import Prelude (putChar, head, tail, last, init, (!!))
import Data.List.Utils import Data.List.Utils
...@@ -346,31 +344,6 @@ evaluate kernelState code output = do ...@@ -346,31 +344,6 @@ evaluate kernelState code output = do
Nothing -> error "Error casting types in Evaluate.hs" Nothing -> error "Error casting types in Evaluate.hs"
Just result -> return result 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)
, "]"
]
{-
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 :: KernelState -> Interpreter EvalOut -> Interpreter EvalOut
safely state = ghandle handler . ghandle sourceErrorHandler safely state = ghandle handler . ghandle sourceErrorHandler
where where
......
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