@@ -230,6 +230,7 @@ module Database.Bloodhound.Types
230230 ) where
231231
232232import Control.Applicative
233+import Control.Monad.Catch
233234import Control.Monad.Error
234235import Control.Monad.Reader
235236import Control.Monad.State
@@ -237,9 +238,9 @@ import Control.Monad.Writer
237238import Data.Aeson
238239import Data.Aeson.Types (Pair, emptyObject, parseMaybe)
239240import qualified Data.ByteString.Lazy.Char8 as L
240−import Data.List (nub, foldl')
241−import Data.List.NonEmpty (NonEmpty (..), toList)
242241import qualified Data.HashMap.Strict as HM (union)
242+import Data.List (foldl', nub)
243+import Data.List.NonEmpty (NonEmpty (..), toList)
243244import qualified Data.Map.Strict as M
244245import Data.Maybe
245246import Data.Text (Text)
@@ -290,7 +291,10 @@ newtype BH m a = BH {
290291 , MonadError e
291292 , Alternative
292293 , MonadPlus
293− , MonadFix)
294+ , MonadFix
295+ , MonadThrow
296+ , MonadCatch
297+ , MonadMask)
294298
295299instance MonadTrans BH where
296300 lift = BH . lift
@@ -373,7 +377,7 @@ data FieldDefinition =
373377 https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html
374378-}
375379data IndexTemplate =
376− IndexTemplate { templatePattern :: TemplatePattern
380+ IndexTemplate { templatePattern :: TemplatePattern
377381 , templateSettings :: Maybe IndexSettings
378382 , templateMappings :: [Value]
379383 }
@@ -407,9 +411,9 @@ data BulkOperation =
407411{-| 'EsResult' describes the standard wrapper JSON document that you see in
408412 successful Elasticsearch lookups or lookups that couldn't find the document.
409413-}
410−data EsResult a = EsResult { _index :: Text
411− , _type :: Text
412− , _id :: Text
414+data EsResult a = EsResult { _index :: Text
415+ , _type :: Text
416+ , _id :: Text
413417 , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Show)
414418
415419
@@ -417,7 +421,7 @@ data EsResult a = EsResult { _index :: Text
417421 'EsResult' when the document was successfully found.
418422-}
419423data EsResultFound a = EsResultFound { _version :: DocVersion
420− , _source :: a } deriving (Eq, Show)
424+ , _source :: a } deriving (Eq, Show)
421425
422426
423427
@@ -1388,7 +1392,7 @@ data ValueCountAggregation = FieldValueCount FieldName
13881392
13891393-- | Single-bucket filter aggregations. See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html#search-aggregations-bucket-filter-aggregation> for more information.
13901394data FilterAggregation = FilterAggregation { faFilter :: Filter
1391− , faAggs :: Maybe Aggregations} deriving (Eq, Show)
1395+ , faAggs :: Maybe Aggregations} deriving (Eq, Show)
13921396
13931397mkTermsAggregation :: Text -> TermsAggregation
13941398mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing