<commit_before>{-# LANGUAGE NoImplicitPrelude, DoAndIfThenElse, NoOverloadedStrings, TypeSynonymInstances, GADTs, CPP #-}

{- | Description : Wrapper around GHC API, exposing a single `evaluate` interface that runs
                   a statement, declaration, import, or directive.

This module exports all functions used for evaluation of IHaskell input.
-}
module IHaskell.Eval.Evaluate (
    interpret,
    evaluate,
    Interpreter,
    liftIO,
    typeCleaner,
    globalImports,
    formatType,
    ) where

import           IHaskellPrelude
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import qualified Data.ByteString.Char8 as CBS

import           Control.Concurrent (forkIO, threadDelay)
import           Prelude (putChar, head, tail, last, init, (!!))
import           Data.List.Utils
import           Data.List (findIndex, and, foldl1, nubBy)
import           Data.String.Utils
import           Text.Printf
import           Data.Char as Char
import           Data.Dynamic
import           Data.Typeable
import qualified Data.Serialize as Serialize
import           System.Directory
import           Filesystem.Path.CurrentOS (encodeString)
#if !MIN_VERSION_base(4,8,0)
import           System.Posix.IO (createPipe)
#endif
import           System.Posix.IO (fdToHandle)
import           System.IO (hGetChar, hFlush)
import           System.Random (getStdGen, randomRs)
import           Unsafe.Coerce
import           Control.Monad (guard)
import           System.Process
import           System.Exit
import           Data.Maybe (fromJust)
import qualified Control.Monad.IO.Class as MonadIO (MonadIO, liftIO)
import qualified MonadUtils (MonadIO, liftIO)
import           System.Environment (getEnv)
import qualified Data.Map as Map

import           NameSet
import           Name
import           PprTyThing
import           InteractiveEval
import           DynFlags
import           Type
import           Exception (gtry)
import           HscTypes
import           HscMain
import qualified Linker
import           TcType
import           Unify
import           InstEnv

#if MIN_VERSION_ghc(7, 8, 0)
import           GhcMonad (liftIO, withSession)
#else
import           GhcMonad (withSession)
#endif

import           GHC hiding (Stmt, TypeSig)
import           Exception hiding (evaluate)
import           Outputable hiding ((<>))
import           Packages
import           Module hiding (Module)
import qualified Pretty
import           FastString
import           Bag
import           ErrUtils (errMsgShortDoc, errMsgExtraInfo)

import           IHaskell.Types
import           IHaskell.IPython
import           IHaskell.Eval.Parser
import           IHaskell.Eval.Lint
import           IHaskell.Display
import qualified IHaskell.Eval.Hoogle as Hoogle
import           IHaskell.Eval.Util
import           IHaskell.BrokenPackages
import qualified IHaskell.IPython.Message.UUID as UUID
<commit_msg>Fix formatting in IHaskell/Eval/Evaluate.hs<commit_after>{-# LANGUAGE NoImplicitPrelude, DoAndIfThenElse, NoOverloadedStrings, TypeSynonymInstances, GADTs, CPP #-}

{- | Description : Wrapper around GHC API, exposing a single `evaluate` interface that runs
                   a statement, declaration, import, or directive.

This module exports all functions used for evaluation of IHaskell input.
-}
module IHaskell.Eval.Evaluate (
    interpret,
    evaluate,
    Interpreter,
    liftIO,
    typeCleaner,
    globalImports,
    formatType,
    ) where

import           IHaskellPrelude
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import qualified Data.ByteString.Char8 as CBS

import           Control.Concurrent (forkIO, threadDelay)
import           Prelude (putChar, head, tail, last, init, (!!))
import           Data.List.Utils
import           Data.List (findIndex, and, foldl1, nubBy)
import           Data.String.Utils
import           Text.Printf
import           Data.Char as Char
import           Data.Dynamic
import           Data.Typeable
import qualified Data.Serialize as Serialize
import           System.Directory
import           Filesystem.Path.CurrentOS (encodeString)
#if !MIN_VERSION_base(4,8,0)
import           System.Posix.IO (createPipe)
#endif
import           System.Posix.IO (fdToHandle)
import           System.IO (hGetChar, hFlush)
import           System.Random (getStdGen, randomRs)
import           Unsafe.Coerce
import           Control.Monad (guard)
import           System.Process
import           System.Exit
import           Data.Maybe (fromJust)
import qualified Control.Monad.IO.Class as MonadIO (MonadIO, liftIO)
import qualified MonadUtils (MonadIO, liftIO)
import           System.Environment (getEnv)
import qualified Data.Map as Map

import           NameSet
import           Name
import           PprTyThing
import           InteractiveEval
import           DynFlags
import           Type
import           Exception (gtry)
import           HscTypes
import           HscMain
import qualified Linker
import           TcType
import           Unify
import           InstEnv
#if MIN_VERSION_ghc(7, 8, 0)
import           GhcMonad (liftIO, withSession)
#else
import           GhcMonad (withSession)
#endif
import           GHC hiding (Stmt, TypeSig)
import           Exception hiding (evaluate)
import           Outputable hiding ((<>))
import           Packages
import           Module hiding (Module)
import qualified Pretty
import           FastString
import           Bag
import           ErrUtils (errMsgShortDoc, errMsgExtraInfo)

import           IHaskell.Types
import           IHaskell.IPython
import           IHaskell.Eval.Parser
import           IHaskell.Eval.Lint
import           IHaskell.Display
import qualified IHaskell.Eval.Hoogle as Hoogle
import           IHaskell.Eval.Util
import           IHaskell.BrokenPackages
import qualified IHaskell.IPython.Message.UUID as UUID

{'fraction_non_alphanumeric': 0.05724183437809304, 'fraction_numerical': 0.0026393929396238865, 'mean_word_length': 2.3702056698165648, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5423780', 'n_tokens_mistral': 1685, 'n_tokens_neox': 1615, 'n_words': 519}