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 stock (PanePid -> PanePid -> Bool
(PanePid -> PanePid -> Bool)
-> (PanePid -> PanePid -> Bool) -> Eq PanePid
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PanePid -> PanePid -> Bool
== :: PanePid -> PanePid -> Bool
$c/= :: PanePid -> PanePid -> Bool
/= :: 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
$cshowsPrec :: Int -> PanePid -> ShowS
showsPrec :: Int -> PanePid -> ShowS
$cshow :: PanePid -> String
show :: PanePid -> String
$cshowList :: [PanePid] -> ShowS
showList :: [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
$cfrom :: forall x. PanePid -> Rep PanePid x
from :: forall x. PanePid -> Rep PanePid x
$cto :: forall x. Rep PanePid x -> PanePid
to :: forall x. Rep PanePid x -> PanePid
Generic)
  deriving anyclass (TmuxQuery
Text -> Either DecodeError PanePid
(Text -> Either DecodeError PanePid)
-> TmuxQuery -> TmuxCodec PanePid
forall a.
(Text -> Either DecodeError a) -> TmuxQuery -> TmuxCodec a
$cdecode :: Text -> Either DecodeError PanePid
decode :: Text -> Either DecodeError PanePid
$cquery :: TmuxQuery
query :: TmuxQuery
TmuxCodec)

instance HasPaneId PanePid where
  paneId :: PanePid -> PaneId
paneId = (.paneId)