<commit_before>{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE FlexibleInstances          #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

-------------------------------------------------------------------------------
-- |
-- Module : Database.Bloodhound.Types.Internal
-- Copyright : (C) 2014 <NAME>
-- License : BSD-style (see the file LICENSE)
-- Maintainer : <NAME> <<EMAIL>
-- Stability : provisional
-- Portability : DeriveGeneric, RecordWildCards
--
-- Internal data types for Bloodhound. These types may change without
-- notice so import at your own risk.
-------------------------------------------------------------------------------
module Database.Bloodhound.Types.Internal
    ( BHEnv(..)
    , Server(..)
    , MonadBH(..)
    ) where


import           Control.Monad.Reader
import           Data.Text            (Text)
import           Data.Typeable        (Typeable)
import           GHC.Generics         (Generic)
import           Network.HTTP.Client

{-| Common environment for Elasticsearch calls. Connections will be
    pipelined according to the provided HTTP connection manager.
-}
data BHEnv = BHEnv { bhServer      :: Server
                   , bhManager     :: Manager
                   , bhRequestHook :: Request -> IO Request<commit_msg>Add Applicative for old-timers<commit_after>{-# LANGUAGE DeriveDataTypeable         #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE FlexibleInstances          #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

-------------------------------------------------------------------------------
-- |
-- Module : Database.Bloodhound.Types.Internal
-- Copyright : (C) 2014 <NAME>
-- License : BSD-style (see the file LICENSE)
-- Maintainer : <NAME> <<EMAIL>
-- Stability : provisional
-- Portability : DeriveGeneric, RecordWildCards
--
-- Internal data types for Bloodhound. These types may change without
-- notice so import at your own risk.
-------------------------------------------------------------------------------
module Database.Bloodhound.Types.Internal
    ( BHEnv(..)
    , Server(..)
    , MonadBH(..)
    ) where


import           Control.Applicative
import           Control.Monad.Reader
import           Data.Text            (Text)
import           Data.Typeable        (Typeable)
import           GHC.Generics         (Generic)
import           Network.HTTP.Client

{-| Common environment for Elasticsearch calls. Connections will be
    pipelined according to the provided HTTP connection manager.
-}
data BHEnv = BHEnv { bhServer      :: Server
                   , bhManager     :: Manager
                   , bhRequestHook :: Request -> IO Request
{'fraction_non_alphanumeric': 0.20904373610081542, 'fraction_numerical': 0.0029651593773165306, 'mean_word_length': 1.5462264150943397, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5702372', 'n_tokens_mistral': 707, 'n_tokens_neox': 681, 'n_words': 188}