{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
module Data.JsonRpc.Response (
  Response (..),
  ) where

import Data.JsonRpc.Success (Success (..))
import Data.JsonRpc.Failure (Failure (..))


newtype Response e a =
  Response (Either (Failure e) (Success a))
  deriving (Response e a -> Response e a -> Bool
(Response e a -> Response e a -> Bool)
-> (Response e a -> Response e a -> Bool) -> Eq (Response e a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall e a. (Eq e, Eq a) => Response e a -> Response e a -> Bool
/= :: Response e a -> Response e a -> Bool
$c/= :: forall e a. (Eq e, Eq a) => Response e a -> Response e a -> Bool
== :: Response e a -> Response e a -> Bool
$c== :: forall e a. (Eq e, Eq a) => Response e a -> Response e a -> Bool
Eq, Int -> Response e a -> ShowS
[Response e a] -> ShowS
Response e a -> String
(Int -> Response e a -> ShowS)
-> (Response e a -> String)
-> ([Response e a] -> ShowS)
-> Show (Response e a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall e a. (Show e, Show a) => Int -> Response e a -> ShowS
forall e a. (Show e, Show a) => [Response e a] -> ShowS
forall e a. (Show e, Show a) => Response e a -> String
showList :: [Response e a] -> ShowS
$cshowList :: forall e a. (Show e, Show a) => [Response e a] -> ShowS
show :: Response e a -> String
$cshow :: forall e a. (Show e, Show a) => Response e a -> String
showsPrec :: Int -> Response e a -> ShowS
$cshowsPrec :: forall e a. (Show e, Show a) => Int -> Response e a -> ShowS
Show, a -> Response e b -> Response e a
(a -> b) -> Response e a -> Response e b
(forall a b. (a -> b) -> Response e a -> Response e b)
-> (forall a b. a -> Response e b -> Response e a)
-> Functor (Response e)
forall a b. a -> Response e b -> Response e a
forall a b. (a -> b) -> Response e a -> Response e b
forall e a b. a -> Response e b -> Response e a
forall e a b. (a -> b) -> Response e a -> Response e b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Response e b -> Response e a
$c<$ :: forall e a b. a -> Response e b -> Response e a
fmap :: (a -> b) -> Response e a -> Response e b
$cfmap :: forall e a b. (a -> b) -> Response e a -> Response e b
Functor)