module Chiasma.Codec.Data.PanePid where

import Chiasma.Codec (TmuxCodec)
import Chiasma.Data.TmuxId (HasPaneId, PaneId)
import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId(paneId))

data PanePid =
  PanePid {
    PanePid -> PaneId
paneId :: PaneId,
    PanePid -> Int
panePid :: Int
  }
  deriving (PanePid -> PanePid -> Bool
(PanePid -> PanePid -> Bool)
-> (PanePid -> PanePid -> Bool) -> Eq PanePid
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PanePid -> PanePid -> Bool
$c/= :: PanePid -> PanePid -> Bool
== :: PanePid -> PanePid -> Bool
$c== :: PanePid -> PanePid -> Bool
Eq, Int -> PanePid -> ShowS
[PanePid] -> ShowS
PanePid -> String
(Int -> PanePid -> ShowS)
-> (PanePid -> String) -> ([PanePid] -> ShowS) -> Show PanePid
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PanePid] -> ShowS
$cshowList :: [PanePid] -> ShowS
show :: PanePid -> String
$cshow :: PanePid -> String
showsPrec :: Int -> PanePid -> ShowS
$cshowsPrec :: Int -> PanePid -> ShowS
Show, (forall x. PanePid -> Rep PanePid x)
-> (forall x. Rep PanePid x -> PanePid) -> Generic PanePid
forall x. Rep PanePid x -> PanePid
forall x. PanePid -> Rep PanePid x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PanePid x -> PanePid
$cfrom :: forall x. PanePid -> Rep PanePid x
Generic, TmuxQuery
Text -> Either TmuxDecodeError PanePid
(Text -> Either TmuxDecodeError PanePid)
-> TmuxQuery -> TmuxCodec PanePid
forall a.
(Text -> Either TmuxDecodeError a) -> TmuxQuery -> TmuxCodec a
query :: TmuxQuery
$cquery :: TmuxQuery
decode :: Text -> Either TmuxDecodeError PanePid
$cdecode :: Text -> Either TmuxDecodeError PanePid
TmuxCodec)

instance HasPaneId PanePid where
  paneId :: PanePid -> PaneId
paneId = PanePid -> PaneId
paneId