packages feed

themoviedb-1.1.1.0 / src / Network / API / TheMovieDB / Internal / SearchResults.hs

{-# LANGUAGE OverloadedStrings #-}{-This file is part of the Haskell package themoviedb. It is subject tothe license terms in the LICENSE file found in the top-level directoryof this distribution and at git://pmade.com/themoviedb/LICENSE. Nopart of themoviedb package, including this file, may be copied,modified, propagated, or distributed except according to the termscontained in the LICENSE file.-}---------------------------------------------------------------------------------- | Utility type for processing movie search results.module Network.API.TheMovieDB.Internal.SearchResults       ( SearchResults (..)       ) where--------------------------------------------------------------------------------import Control.Applicativeimport Data.Aeson---------------------------------------------------------------------------------- | Internal wrapper to parse a list of results from JSON.newtype SearchResults a = SearchResults {searchResults :: [a]}                          deriving (Eq, Show)--------------------------------------------------------------------------------instance (FromJSON a) => FromJSON (SearchResults a) where  parseJSON (Object v) = SearchResults <$> v .: "results"  parseJSON _          = empty