From c518b8ed7f158145664dc51797f1305dad46dd03 Mon Sep 17 00:00:00 2001 From: Chris Allen Date: Mon, 19 Oct 2015 11:17:40 -0500 Subject: [PATCH] warnings clean up --- tests/tests.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/tests.hs b/tests/tests.hs index 3d45a41..fdd8728 100644 --- a/tests/tests.hs +++ b/tests/tests.hs @@ -14,7 +14,6 @@ import Data.List (nub) import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NE import qualified Data.Map.Strict as M -import qualified Data.Maybe as MY import Data.Monoid import Data.Text (Text) import qualified Data.Text as T @@ -112,10 +111,14 @@ data Tweet = Tweet { user :: Text , location :: Location } deriving (Eq, Generic, Show) -instance ToJSON Tweet -instance FromJSON Tweet -instance ToJSON Location -instance FromJSON Location +instance ToJSON Tweet where + toJSON = genericToJSON defaultOptions +instance FromJSON Tweet where + parseJSON = genericParseJSON defaultOptions +instance ToJSON Location where + toJSON = genericToJSON defaultOptions +instance FromJSON Location where + parseJSON = genericParseJSON defaultOptions data ParentMapping = ParentMapping deriving (Eq, Show) @@ -315,7 +318,7 @@ instance Arbitrary a => Arbitrary (SearchHits a) where getSource :: EsResult a -> Maybe a getSource = fmap _source . foundResult --- grabFirst :: Either String (SearchResult a) -> Either String a +grabFirst :: Either String (SearchResult a) -> Either String a grabFirst r = case fmap (hitSource . head . hits . searchHits) r of (Left e) -> Left e