packages feed

chiasma 0.2.0.0 → 0.10.0.0

raw patch · 127 files changed

+3095/−2504 lines, 127 filesdep +exondep +extradep +first-class-familiesdep −aesondep −chiasmadep −composition-extradep ~attoparsecdep ~basedep ~compositionsetup-changedPVP ok

version bump matches the API change (PVP)

Dependencies added: exon, extra, first-class-families, path, polysemy, polysemy-conc, polysemy-log, polysemy-plugin, polysemy-process, polysemy-time, prelate

Dependencies removed: aeson, chiasma, composition-extra, conduit, conduit-extra, cornea, data-default, deepseq, directory, either, exceptions, filepath, free, hedgehog, mtl, posix-pty, process, relude, resourcet, split, stm-chans, stm-conduit, tasty, tasty-hedgehog, unix, unliftio, unliftio-core

Dependency ranges changed: attoparsec, base, composition, lens, parsers, prettyprinter, prettyprinter-ansi-terminal, random, typed-process, uuid

API changes (from Hackage documentation)

- Chiasma.Api.Class: class TmuxApi m a
- Chiasma.Api.Class: runCommands :: TmuxApi m a => a -> (Text -> Either TmuxDecodeError b) -> Cmds -> m [b]
- Chiasma.Api.Class: withTmux :: TmuxApi m a => a -> (ConduitT (Flush Cmd) Void m () -> ConduitT () TmuxOutputBlock m () -> m b) -> m b
- Chiasma.Codec: TmuxQuery :: Text -> TmuxQuery
- Chiasma.Codec: [$sel:unQ:TmuxQuery] :: TmuxQuery -> Text
- Chiasma.Codec: instance GHC.Classes.Eq Chiasma.Codec.TmuxQuery
- Chiasma.Codec: instance GHC.Show.Show Chiasma.Codec.TmuxQuery
- Chiasma.Codec: newtype TmuxQuery
- Chiasma.Codec.Data.PaneDetail: PaneDetail :: PaneId -> Int -> Int -> Int -> Int -> PaneDetail
- Chiasma.Codec.Data.PaneDetail: [$sel:paneHeight:PaneDetail] :: PaneDetail -> Int
- Chiasma.Codec.Data.PaneDetail: [$sel:paneId:PaneDetail] :: PaneDetail -> PaneId
- Chiasma.Codec.Data.PaneDetail: [$sel:paneLeft:PaneDetail] :: PaneDetail -> Int
- Chiasma.Codec.Data.PaneDetail: [$sel:paneTop:PaneDetail] :: PaneDetail -> Int
- Chiasma.Codec.Data.PaneDetail: [$sel:paneWidth:PaneDetail] :: PaneDetail -> Int
- Chiasma.Codec.Data.PaneDetail: data PaneDetail
- Chiasma.Codec.Data.PaneDetail: instance Chiasma.Codec.TmuxCodec Chiasma.Codec.Data.PaneDetail.PaneDetail
- Chiasma.Codec.Data.PaneDetail: instance Chiasma.Data.TmuxId.HasPaneId Chiasma.Codec.Data.PaneDetail.PaneDetail
- Chiasma.Codec.Data.PaneDetail: instance GHC.Classes.Eq Chiasma.Codec.Data.PaneDetail.PaneDetail
- Chiasma.Codec.Data.PaneDetail: instance GHC.Generics.Generic Chiasma.Codec.Data.PaneDetail.PaneDetail
- Chiasma.Codec.Data.PaneDetail: instance GHC.Show.Show Chiasma.Codec.Data.PaneDetail.PaneDetail
- Chiasma.Codec.Decode: BoolParsingFailure :: Text -> TmuxDecodeError
- Chiasma.Codec.Decode: IntParsingFailure :: Text -> TmuxDecodeError
- Chiasma.Codec.Decode: ParseFailure :: Text -> ParseError -> TmuxDecodeError
- Chiasma.Codec.Decode: TooFewFields :: TmuxDecodeError
- Chiasma.Codec.Decode: TooManyFields :: [Text] -> TmuxDecodeError
- Chiasma.Codec.Decode: data TmuxDecodeError
- Chiasma.Codec.Decode: decode' :: TmuxDataDecode f => [Text] -> Either TmuxDecodeError ([Text], f a)
- Chiasma.Codec.Decode: instance GHC.Classes.Eq Chiasma.Codec.Decode.TmuxDecodeError
- Chiasma.Codec.Decode: instance GHC.Show.Show Chiasma.Codec.Decode.TmuxDecodeError
- Chiasma.Codec.Query: query' :: TmuxDataQuery f => [Text]
- Chiasma.Command.Pane: formatLine :: Text -> [Text]
- Chiasma.Command.Pane: paneCoords :: MonadFree TmuxThunk m => PaneId -> m (Maybe PaneCoords)
- Chiasma.Command.Pane: panePid :: MonadFree TmuxThunk m => PaneId -> m (Maybe PanePid)
- Chiasma.Command.Pane: panePids :: MonadFree TmuxThunk m => m [PanePid]
- Chiasma.Command.Pane: paneTarget :: PaneId -> [Text]
- Chiasma.Command.Pane: panesAs :: (MonadFree TmuxThunk m, TmuxCodec a) => m [a]
- Chiasma.Command.Pane: sameId :: HasPaneId a => PaneId -> a -> Bool
- Chiasma.Command.Pane: windowPanesAs :: (MonadFree TmuxThunk m, TmuxCodec a) => WindowId -> m [a]
- Chiasma.Command.Session: activateSession :: MonadFree TmuxThunk m => Int -> m ()
- Chiasma.Command.Window: splitWindowAs :: (MonadFree TmuxThunk m, TmuxCodec a) => FilePath -> WindowId -> m a
- Chiasma.Data.Conduit: createSinkFlush :: MonadIO m => StreamSpec 'STInput (ConduitT (Flush ByteString) o m ())
- Chiasma.Data.Ident: instance Control.DeepSeq.NFData Chiasma.Data.Ident.Ident
- Chiasma.Data.Maybe: findMaybe :: (a -> Maybe b) -> [a] -> Maybe b
- Chiasma.Data.Maybe: maybeExcept :: MonadError e m => e -> Maybe a -> m a
- Chiasma.Data.Maybe: orElse :: Maybe a -> Maybe a -> Maybe a
- Chiasma.Data.RenderError: _Fatal :: AsRenderError r_a10xW => Prism' r_a10xW TmuxError
- Chiasma.Data.RenderError: _NoPrincipal :: AsRenderError r_a10xW => Prism' r_a10xW Ident
- Chiasma.Data.RenderError: _Pack :: AsRenderError r_a10xW => Prism' r_a10xW Text
- Chiasma.Data.RenderError: _RenderError :: AsRenderError r_a10xW => Prism' r_a10xW RenderError
- Chiasma.Data.RenderError: _Views :: AsRenderError r_a10xW => Prism' r_a10xW ViewsError
- Chiasma.Data.RenderError: class AsRenderError r_a10xW
- Chiasma.Data.RenderError: instance Chiasma.Data.RenderError.AsRenderError Chiasma.Data.RenderError.RenderError
- Chiasma.Data.RenderError: instance Data.DeepPrisms.DeepPrisms Chiasma.Data.RenderError.RenderError Chiasma.Data.RenderError.RenderError
- Chiasma.Data.RenderError: instance Data.DeepPrisms.DeepPrisms Chiasma.Data.RenderError.RenderError Chiasma.Data.TmuxError.TmuxError
- Chiasma.Data.RenderError: instance Data.DeepPrisms.DeepPrisms Chiasma.Data.RenderError.RenderError Chiasma.Data.Views.ViewsError
- Chiasma.Data.TmuxError: CommandFailed :: Cmds -> [Text] -> TmuxError
- Chiasma.Data.TmuxError: DecodingFailed :: Cmds -> Text -> TmuxDecodeError -> TmuxError
- Chiasma.Data.TmuxError: InvalidOutput :: Text -> Text -> TmuxError
- Chiasma.Data.TmuxError: NoOutput :: Cmds -> TmuxError
- Chiasma.Data.TmuxError: OutputParsingFailed :: Cmds -> [Text] -> ParseError -> TmuxError
- Chiasma.Data.TmuxError: [$sel:commandFailedCmds:ProcessFailed] :: TmuxError -> Cmds
- Chiasma.Data.TmuxError: [$sel:commandFailedError:ProcessFailed] :: TmuxError -> [Text]
- Chiasma.Data.TmuxError: [$sel:decodingFailedCmds:ProcessFailed] :: TmuxError -> Cmds
- Chiasma.Data.TmuxError: [$sel:decodingFailedError:ProcessFailed] :: TmuxError -> TmuxDecodeError
- Chiasma.Data.TmuxError: [$sel:decodingFailedOutput:ProcessFailed] :: TmuxError -> Text
- Chiasma.Data.TmuxError: [$sel:invalidOutputCommand:ProcessFailed] :: TmuxError -> Text
- Chiasma.Data.TmuxError: [$sel:invalidOutputReason:ProcessFailed] :: TmuxError -> Text
- Chiasma.Data.TmuxError: [$sel:parsingFailedCmds:ProcessFailed] :: TmuxError -> Cmds
- Chiasma.Data.TmuxError: [$sel:parsingFailedError:ProcessFailed] :: TmuxError -> ParseError
- Chiasma.Data.TmuxError: [$sel:parsingFailedOutput:ProcessFailed] :: TmuxError -> [Text]
- Chiasma.Data.TmuxError: [$sel:processFailedCmds:ProcessFailed] :: TmuxError -> Cmds
- Chiasma.Data.TmuxError: [$sel:processFailedReason:ProcessFailed] :: TmuxError -> Text
- Chiasma.Data.TmuxError: instance Data.DeepPrisms.DeepPrisms Chiasma.Data.TmuxError.TmuxError Chiasma.Data.TmuxError.TmuxError
- Chiasma.Data.TmuxThunk: Failed :: TmuxError -> TmuxThunk next
- Chiasma.Data.TmuxThunk: Flush :: (() -> next) -> TmuxThunk next
- Chiasma.Data.TmuxThunk: Read :: Cmd -> (Text -> Either TmuxDecodeError a) -> ([a] -> next) -> TmuxThunk next
- Chiasma.Data.TmuxThunk: Write :: Cmd -> (() -> next) -> TmuxThunk next
- Chiasma.Data.TmuxThunk: data TmuxThunk next
- Chiasma.Data.TmuxThunk: instance GHC.Base.Functor Chiasma.Data.TmuxThunk.TmuxThunk
- Chiasma.Data.Views: _NoPaneId :: AsViewsError r_aScM => Prism' r_aScM Ident
- Chiasma.Data.Views: _NoSuchPane :: AsViewsError r_aScM => Prism' r_aScM Ident
- Chiasma.Data.Views: _NoSuchSession :: AsViewsError r_aScM => Prism' r_aScM Ident
- Chiasma.Data.Views: _NoSuchWindow :: AsViewsError r_aScM => Prism' r_aScM Ident
- Chiasma.Data.Views: _ViewsError :: AsViewsError r_aScM => Prism' r_aScM ViewsError
- Chiasma.Data.Views: class AsViewsError r_aScM
- Chiasma.Data.Views: instance Chiasma.Data.Views.AsViewsError Chiasma.Data.Views.ViewsError
- Chiasma.Data.Views: instance Data.DeepLenses.DeepLenses Chiasma.Data.Views.Views Chiasma.Data.Views.Views
- Chiasma.Data.Views: instance Data.DeepPrisms.DeepPrisms Chiasma.Data.Views.ViewsError Chiasma.Data.Views.ViewsError
- Chiasma.Monad.EvalFreeT: CmdBuffer :: [Cmd] -> CmdBuffer
- Chiasma.Monad.EvalFreeT: evalFreeF :: Monad m => CommandExec m -> CmdBuffer -> FreeF TmuxThunk a (FreeT TmuxThunk m a) -> m (Either TmuxError a)
- Chiasma.Monad.EvalFreeT: evalFreeT :: Monad m => CommandExec m -> CmdBuffer -> FreeT TmuxThunk m a -> m (Either TmuxError a)
- Chiasma.Monad.EvalFreeT: instance Data.Default.Class.Default Chiasma.Monad.EvalFreeT.CmdBuffer
- Chiasma.Monad.EvalFreeT: newtype CmdBuffer
- Chiasma.Monad.EvalFreeT: type CommandExec m = (forall b. (Text -> Either TmuxDecodeError b) -> Cmds -> m (Either TmuxError [b]))
- Chiasma.Monad.IndividualProcess: TmuxState :: [Cmd] -> TmuxState
- Chiasma.Monad.IndividualProcess: instance Data.Default.Class.Default Chiasma.Monad.IndividualProcess.TmuxState
- Chiasma.Monad.IndividualProcess: interpret :: (TmuxApi m api, MonadDeepError e TmuxError m) => TmuxState -> api -> TmuxProg a -> m a
- Chiasma.Monad.IndividualProcess: newtype TmuxState
- Chiasma.Monad.IndividualProcess: runTmux :: (TmuxApi m api, MonadDeepError e TmuxError m) => api -> TmuxProg a -> m a
- Chiasma.Monad.IndividualProcess: type TmuxProg = Free TmuxThunk
- Chiasma.Monad.Stream: executeCommands :: MonadIO m => WriteCmd m -> ReadOutput m -> (Text -> Either TmuxDecodeError a) -> Cmds -> m (Either TmuxError [a])
- Chiasma.Monad.Stream: handleProcessOutput :: Cmds -> (Text -> Either TmuxDecodeError a) -> [TmuxOutputBlock] -> Either TmuxError [a]
- Chiasma.Monad.Stream: runTmux :: (MonadIO m, MonadDeepError e TmuxError m, TmuxApi m api) => api -> TmuxProg m a -> m a
- Chiasma.Monad.Stream: runTmuxE :: (MonadIO m, TmuxApi m api) => api -> TmuxProg m a -> m (Either TmuxError a)
- Chiasma.Monad.Stream: runTmuxProg :: MonadIO m => TmuxProg m a -> WriteCmd m -> ReadOutput m -> m (Either TmuxError a)
- Chiasma.Monad.Stream: type ReadOutput m = ConduitT () TmuxOutputBlock m ()
- Chiasma.Monad.Stream: type TmuxProg = FreeT TmuxThunk
- Chiasma.Monad.Stream: type WriteCmd m = ConduitT (Flush Cmd) Void m ()
- Chiasma.Monad.Tmux: flush :: MonadFree TmuxThunk m => m ()
- Chiasma.Monad.Tmux: read :: forall a m. (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m [a]
- Chiasma.Monad.Tmux: readFirst :: forall a m. (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m (Maybe a)
- Chiasma.Monad.Tmux: readRaw :: forall m. MonadFree TmuxThunk m => Text -> [Text] -> m [Text]
- Chiasma.Monad.Tmux: unsafeReadFirst :: forall a m. (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m a
- Chiasma.Monad.Tmux: unsafeReadOne :: forall a m. (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m a
- Chiasma.Monad.Tmux: write :: MonadFree TmuxThunk m => Text -> [Text] -> m ()
- Chiasma.Native.Api: TmuxNative :: Maybe FilePath -> TmuxNative
- Chiasma.Native.Api: [$sel:tmuxServerSocket:TmuxNative] :: TmuxNative -> Maybe FilePath
- Chiasma.Native.Api: formatCmd :: Cmd -> ByteString
- Chiasma.Native.Api: instance (Control.Monad.IO.Class.MonadIO m, Control.Monad.DeepError.MonadDeepError e Chiasma.Data.TmuxError.TmuxError m, Control.Monad.Catch.MonadMask m) => Chiasma.Api.Class.TmuxApi m Chiasma.Native.Api.TmuxNative
- Chiasma.Native.Api: instance GHC.Show.Show Chiasma.Native.Api.TmuxNative
- Chiasma.Native.Api: newtype TmuxNative
- Chiasma.Native.Api: tmuxProcessConfig :: MonadIO m => Maybe FilePath -> ProcessConfig (ConduitT (Flush ByteString) Void m ()) (ConduitT () ByteString m ()) ()
- Chiasma.Native.Api: withProcess :: (MonadIO m, MonadMask m) => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a
- Chiasma.Native.Process: cmdBytes :: [Text] -> ByteString
- Chiasma.Native.Process: formatCmd :: Cmd -> Text
- Chiasma.Native.Process: handleProcessOutput :: Cmds -> ExitCode -> (Text -> Either TmuxDecodeError a) -> Text -> Either TmuxError [a]
- Chiasma.Native.Process: nativeTmuxProcess :: (MonadIO m, MonadDeepError e TmuxError m) => Maybe FilePath -> (Text -> Either TmuxDecodeError a) -> Cmds -> m [a]
- Chiasma.Native.Process: socketArg :: Maybe FilePath -> [Text]
- Chiasma.Native.Process: tmuxProcessConfig :: Maybe FilePath -> [Text] -> ProcessConfig () () ()
- Chiasma.Native.StreamParse: Error :: [Text] -> TmuxOutputBlock
- Chiasma.Native.StreamParse: Success :: [Text] -> TmuxOutputBlock
- Chiasma.Native.StreamParse: data TmuxOutputBlock
- Chiasma.Native.StreamParse: instance GHC.Classes.Eq Chiasma.Native.StreamParse.End
- Chiasma.Native.StreamParse: instance GHC.Classes.Eq Chiasma.Native.StreamParse.TmuxOutputBlock
- Chiasma.Native.StreamParse: instance GHC.Show.Show Chiasma.Native.StreamParse.End
- Chiasma.Native.StreamParse: instance GHC.Show.Show Chiasma.Native.StreamParse.TmuxOutputBlock
- Chiasma.Native.StreamParse: parseBlocks :: (Alternative m, CharParsing m, Monad m, LookAheadParsing m) => m [TmuxOutputBlock]
- Chiasma.Native.StreamParse: parseConduit :: MonadThrow m => ConduitT ByteString TmuxOutputBlock m ()
- Chiasma.Pack: describeVertical :: Bool -> Doc a
- Chiasma.Prelude: (!!?) :: [a] -> Int -> Maybe a
- Chiasma.Prelude: ($!!) :: NFData a => (a -> b) -> a -> b
- Chiasma.Prelude: ($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- Chiasma.Prelude: ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- Chiasma.Prelude: ($<) :: Contravariant f => f b -> b -> f a
- Chiasma.Prelude: ($>) :: Functor f => f a -> b -> f b
- Chiasma.Prelude: (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
- Chiasma.Prelude: (&&) :: Bool -> Bool -> Bool
- Chiasma.Prelude: (&&^) :: Monad m => m Bool -> m Bool -> m Bool
- Chiasma.Prelude: (&) :: a -> (a -> b) -> b
- Chiasma.Prelude: (*) :: Num a => a -> a -> a
- Chiasma.Prelude: (**) :: Floating a => a -> a -> a
- Chiasma.Prelude: (*>) :: Applicative f => f a -> f b -> f b
- Chiasma.Prelude: (+) :: Num a => a -> a -> a
- Chiasma.Prelude: (++) :: [a] -> [a] -> [a]
- Chiasma.Prelude: (-) :: Num a => a -> a -> a
- Chiasma.Prelude: (.) :: (b -> c) -> (a -> b) -> a -> c
- Chiasma.Prelude: (/) :: Fractional a => a -> a -> a
- Chiasma.Prelude: (/=) :: Eq a => a -> a -> Bool
- Chiasma.Prelude: (:|) :: a -> [a] -> NonEmpty a
- Chiasma.Prelude: (<$!>) :: Monad m => (a -> b) -> m a -> m b
- Chiasma.Prelude: (<$$>) :: (Functor f0, Functor f1) => (a -> b) -> f1 (f0 a) -> f1 (f0 b)
- Chiasma.Prelude: (<$) :: Functor f => a -> f b -> f a
- Chiasma.Prelude: (<$>) :: Functor f => (a -> b) -> f a -> f b
- Chiasma.Prelude: (<&>) :: Functor f => f a -> (a -> b) -> f b
- Chiasma.Prelude: (<) :: Ord a => a -> a -> Bool
- Chiasma.Prelude: (<*) :: Applicative f => f a -> f b -> f a
- Chiasma.Prelude: (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- Chiasma.Prelude: (<*>) :: Applicative f => f (a -> b) -> f a -> f b
- Chiasma.Prelude: (<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
- Chiasma.Prelude: (<<<) :: forall k cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- Chiasma.Prelude: (<=) :: Ord a => a -> a -> Bool
- Chiasma.Prelude: (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- Chiasma.Prelude: (<>) :: Semigroup a => a -> a -> a
- Chiasma.Prelude: (<|>) :: Alternative f => f a -> f a -> f a
- Chiasma.Prelude: (=<<) :: Monad m => (a -> m b) -> m a -> m b
- Chiasma.Prelude: (==) :: Eq a => a -> a -> Bool
- Chiasma.Prelude: (>$$<) :: Contravariant f => f b -> (a -> b) -> f a
- Chiasma.Prelude: (>$) :: Contravariant f => b -> f b -> f a
- Chiasma.Prelude: (>$<) :: Contravariant f => (a -> b) -> f b -> f a
- Chiasma.Prelude: (>) :: Ord a => a -> a -> Bool
- Chiasma.Prelude: (>=) :: Ord a => a -> a -> Bool
- Chiasma.Prelude: (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- Chiasma.Prelude: (>>) :: Monad m => m a -> m b -> m b
- Chiasma.Prelude: (>>=) :: Monad m => m a -> (a -> m b) -> m b
- Chiasma.Prelude: (>>>) :: forall k cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
- Chiasma.Prelude: (?:) :: Maybe a -> a -> a
- Chiasma.Prelude: (??) :: Functor f => f (a -> b) -> a -> f b
- Chiasma.Prelude: (^) :: (Num a, Integral b) => a -> b -> a
- Chiasma.Prelude: (^^) :: (Fractional a, Integral b) => a -> b -> a
- Chiasma.Prelude: (||) :: Bool -> Bool -> Bool
- Chiasma.Prelude: (||^) :: Monad m => m Bool -> m Bool -> m Bool
- Chiasma.Prelude: -- | Type of single element of the structure.
- Chiasma.Prelude: All :: Bool -> All
- Chiasma.Prelude: Alt :: f a -> Alt (f :: k -> Type) (a :: k)
- Chiasma.Prelude: Any :: Bool -> Any
- Chiasma.Prelude: Ap :: f a -> Ap (f :: k -> Type) (a :: k)
- Chiasma.Prelude: AppendMode :: IOMode
- Chiasma.Prelude: Bug :: SomeException -> CallStack -> Bug
- Chiasma.Prelude: Comparison :: (a -> a -> Ordering) -> Comparison a
- Chiasma.Prelude: Compose :: f (g a) -> Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1)
- Chiasma.Prelude: Const :: a -> Const a (b :: k)
- Chiasma.Prelude: D# :: Double# -> Double
- Chiasma.Prelude: Down :: a -> Down a
- Chiasma.Prelude: Dual :: a -> Dual a
- Chiasma.Prelude: EQ :: Ordering
- Chiasma.Prelude: Endo :: (a -> a) -> Endo a
- Chiasma.Prelude: Equivalence :: (a -> a -> Bool) -> Equivalence a
- Chiasma.Prelude: ExceptT :: m (Either e a) -> ExceptT e (m :: Type -> Type) a
- Chiasma.Prelude: F# :: Float# -> Float
- Chiasma.Prelude: False :: Bool
- Chiasma.Prelude: First :: Maybe a -> First a
- Chiasma.Prelude: GT :: Ordering
- Chiasma.Prelude: Identity :: a -> Identity a
- Chiasma.Prelude: Just :: a -> Maybe a
- Chiasma.Prelude: LT :: Ordering
- Chiasma.Prelude: Last :: Maybe a -> Last a
- Chiasma.Prelude: Left :: a -> Either a b
- Chiasma.Prelude: MaybeT :: m (Maybe a) -> MaybeT (m :: Type -> Type) a
- Chiasma.Prelude: Nothing :: Maybe a
- Chiasma.Prelude: Op :: (b -> a) -> Op a b
- Chiasma.Prelude: Option :: Maybe a -> Option a
- Chiasma.Prelude: Predicate :: (a -> Bool) -> Predicate a
- Chiasma.Prelude: Product :: a -> Product a
- Chiasma.Prelude: Proxy :: Proxy (t :: k)
- Chiasma.Prelude: ReadMode :: IOMode
- Chiasma.Prelude: ReadWriteMode :: IOMode
- Chiasma.Prelude: ReaderT :: (r -> m a) -> ReaderT r (m :: Type -> Type) a
- Chiasma.Prelude: Right :: b -> Either a b
- Chiasma.Prelude: SomeException :: e -> SomeException
- Chiasma.Prelude: SomeNat :: Proxy n -> SomeNat
- Chiasma.Prelude: StateT :: (s -> m (a, s)) -> StateT s (m :: Type -> Type) a
- Chiasma.Prelude: Sum :: a -> Sum a
- Chiasma.Prelude: True :: Bool
- Chiasma.Prelude: Undefined :: Undefined
- Chiasma.Prelude: WriteMode :: IOMode
- Chiasma.Prelude: ZipList :: [a] -> ZipList a
- Chiasma.Prelude: [appEndo] :: Endo a -> a -> a
- Chiasma.Prelude: [getAll] :: All -> Bool
- Chiasma.Prelude: [getAlt] :: Alt (f :: k -> Type) (a :: k) -> f a
- Chiasma.Prelude: [getAny] :: Any -> Bool
- Chiasma.Prelude: [getAp] :: Ap (f :: k -> Type) (a :: k) -> f a
- Chiasma.Prelude: [getComparison] :: Comparison a -> a -> a -> Ordering
- Chiasma.Prelude: [getCompose] :: Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1) -> f (g a)
- Chiasma.Prelude: [getConst] :: Const a (b :: k) -> a
- Chiasma.Prelude: [getDown] :: Down a -> a
- Chiasma.Prelude: [getDual] :: Dual a -> a
- Chiasma.Prelude: [getEquivalence] :: Equivalence a -> a -> a -> Bool
- Chiasma.Prelude: [getFirst] :: First a -> Maybe a
- Chiasma.Prelude: [getLast] :: Last a -> Maybe a
- Chiasma.Prelude: [getOp] :: Op a b -> b -> a
- Chiasma.Prelude: [getOption] :: Option a -> Maybe a
- Chiasma.Prelude: [getPredicate] :: Predicate a -> a -> Bool
- Chiasma.Prelude: [getProduct] :: Product a -> a
- Chiasma.Prelude: [getSum] :: Sum a -> a
- Chiasma.Prelude: [getZipList] :: ZipList a -> [a]
- Chiasma.Prelude: [runIdentity] :: Identity a -> a
- Chiasma.Prelude: [runMaybeT] :: MaybeT (m :: Type -> Type) a -> m (Maybe a)
- Chiasma.Prelude: [runReaderT] :: ReaderT r (m :: Type -> Type) a -> r -> m a
- Chiasma.Prelude: [runStateT] :: StateT s (m :: Type -> Type) a -> s -> m (a, s)
- Chiasma.Prelude: abs :: Num a => a -> a
- Chiasma.Prelude: absurd :: Void -> a
- Chiasma.Prelude: acos :: Floating a => a -> a
- Chiasma.Prelude: acosh :: Floating a => a -> a
- Chiasma.Prelude: all :: Foldable t => (a -> Bool) -> t a -> Bool
- Chiasma.Prelude: allM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool
- Chiasma.Prelude: and :: Foldable t => t Bool -> Bool
- Chiasma.Prelude: andM :: (Foldable f, Monad m) => f (m Bool) -> m Bool
- Chiasma.Prelude: any :: Foldable t => (a -> Bool) -> t a -> Bool
- Chiasma.Prelude: anyM :: (Foldable f, Monad m) => (a -> m Bool) -> f a -> m Bool
- Chiasma.Prelude: appendFile :: MonadIO m => FilePath -> String -> m ()
- Chiasma.Prelude: appendFileBS :: MonadIO m => FilePath -> ByteString -> m ()
- Chiasma.Prelude: appendFileLBS :: MonadIO m => FilePath -> LByteString -> m ()
- Chiasma.Prelude: appendFileLText :: MonadIO m => FilePath -> LText -> m ()
- Chiasma.Prelude: appendFileText :: MonadIO m => FilePath -> Text -> m ()
- Chiasma.Prelude: appliedTo :: Applicative f => f a -> f (a -> b) -> f b
- Chiasma.Prelude: asTypeOf :: a -> a -> a
- Chiasma.Prelude: asin :: Floating a => a -> a
- Chiasma.Prelude: asinh :: Floating a => a -> a
- Chiasma.Prelude: asum :: (Foldable t, Alternative f) => t (f a) -> f a
- Chiasma.Prelude: asumMap :: forall b m f a. (Foldable f, Alternative m) => (a -> m b) -> f a -> m b
- Chiasma.Prelude: atan :: Floating a => a -> a
- Chiasma.Prelude: atan2 :: RealFloat a => a -> a -> a
- Chiasma.Prelude: atanh :: Floating a => a -> a
- Chiasma.Prelude: atomicModifyIORef :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
- Chiasma.Prelude: atomicModifyIORef' :: MonadIO m => IORef a -> (a -> (a, b)) -> m b
- Chiasma.Prelude: atomicModifyIORef'_ :: MonadIO m => IORef a -> (a -> a) -> m ()
- Chiasma.Prelude: atomicModifyIORef_ :: MonadIO m => IORef a -> (a -> a) -> m ()
- Chiasma.Prelude: atomicWriteIORef :: MonadIO m => IORef a -> a -> m ()
- Chiasma.Prelude: atomically :: MonadIO m => STM a -> m a
- Chiasma.Prelude: biList :: Bifoldable t => t a a -> [a]
- Chiasma.Prelude: biall :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
- Chiasma.Prelude: biand :: Bifoldable t => t Bool Bool -> Bool
- Chiasma.Prelude: biany :: Bifoldable t => (a -> Bool) -> (b -> Bool) -> t a b -> Bool
- Chiasma.Prelude: biasum :: (Bifoldable t, Alternative f) => t (f a) (f a) -> f a
- Chiasma.Prelude: bielem :: (Bifoldable t, Eq a) => a -> t a a -> Bool
- Chiasma.Prelude: bifind :: Bifoldable t => (a -> Bool) -> t a a -> Maybe a
- Chiasma.Prelude: bifold :: (Bifoldable p, Monoid m) => p m m -> m
- Chiasma.Prelude: bifoldMap :: (Bifoldable p, Monoid m) => (a -> m) -> (b -> m) -> p a b -> m
- Chiasma.Prelude: bifoldMapDefault :: (Bitraversable t, Monoid m) => (a -> m) -> (b -> m) -> t a b -> m
- Chiasma.Prelude: bifoldl :: Bifoldable p => (c -> a -> c) -> (c -> b -> c) -> c -> p a b -> c
- Chiasma.Prelude: bifoldl' :: Bifoldable t => (a -> b -> a) -> (a -> c -> a) -> a -> t b c -> a
- Chiasma.Prelude: bifoldlM :: (Bifoldable t, Monad m) => (a -> b -> m a) -> (a -> c -> m a) -> a -> t b c -> m a
- Chiasma.Prelude: bifoldr :: Bifoldable p => (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c
- Chiasma.Prelude: bifoldr' :: Bifoldable t => (a -> c -> c) -> (b -> c -> c) -> c -> t a b -> c
- Chiasma.Prelude: bifoldrM :: (Bifoldable t, Monad m) => (a -> c -> m c) -> (b -> c -> m c) -> c -> t a b -> m c
- Chiasma.Prelude: bifor :: (Bitraversable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f (t c d)
- Chiasma.Prelude: bifor_ :: (Bifoldable t, Applicative f) => t a b -> (a -> f c) -> (b -> f d) -> f ()
- Chiasma.Prelude: bilength :: Bifoldable t => t a b -> Int
- Chiasma.Prelude: bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d
- Chiasma.Prelude: bimapDefault :: Bitraversable t => (a -> b) -> (c -> d) -> t a c -> t b d
- Chiasma.Prelude: binull :: Bifoldable t => t a b -> Bool
- Chiasma.Prelude: bior :: Bifoldable t => t Bool Bool -> Bool
- Chiasma.Prelude: bisequence :: (Bitraversable t, Applicative f) => t (f a) (f b) -> f (t a b)
- Chiasma.Prelude: bisequence_ :: (Bifoldable t, Applicative f) => t (f a) (f b) -> f ()
- Chiasma.Prelude: bitraverse :: (Bitraversable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f (t c d)
- Chiasma.Prelude: bitraverse_ :: (Bifoldable t, Applicative f) => (a -> f c) -> (b -> f d) -> t a b -> f ()
- Chiasma.Prelude: bool :: a -> a -> Bool -> a
- Chiasma.Prelude: boundedEnumFrom :: (Enum a, Bounded a) => a -> [a]
- Chiasma.Prelude: boundedEnumFromThen :: (Enum a, Bounded a) => a -> a -> [a]
- Chiasma.Prelude: break :: (a -> Bool) -> [a] -> ([a], [a])
- Chiasma.Prelude: bug :: (HasCallStack, Exception e) => e -> a
- Chiasma.Prelude: byteSwap16 :: Word16 -> Word16
- Chiasma.Prelude: byteSwap32 :: Word32 -> Word32
- Chiasma.Prelude: byteSwap64 :: Word64 -> Word64
- Chiasma.Prelude: callStack :: HasCallStack => CallStack
- Chiasma.Prelude: catMaybes :: [Maybe a] -> [a]
- Chiasma.Prelude: catchSTM :: Exception e => STM a -> (e -> STM a) -> STM a
- Chiasma.Prelude: ceiling :: (RealFrac a, Integral b) => a -> b
- Chiasma.Prelude: chainedTo :: Monad m => (a -> m b) -> m a -> m b
- Chiasma.Prelude: chr :: Int -> Char
- Chiasma.Prelude: class Applicative f => Alternative (f :: Type -> Type)
- Chiasma.Prelude: class Functor f => Applicative (f :: Type -> Type)
- Chiasma.Prelude: class Bifoldable (p :: Type -> Type -> Type)
- Chiasma.Prelude: class Bifunctor (p :: Type -> Type -> Type)
- Chiasma.Prelude: class (Bifunctor t, Bifoldable t) => Bitraversable (t :: Type -> Type -> Type)
- Chiasma.Prelude: class Bounded a
- Chiasma.Prelude: class a ~R# b => Coercible (a :: k) (b :: k)
- Chiasma.Prelude: class Contravariant (f :: Type -> Type)
- Chiasma.Prelude: class ConvertUtf8 a b
- Chiasma.Prelude: class Default a
- Chiasma.Prelude: class Enum a
- Chiasma.Prelude: class Eq a
- Chiasma.Prelude: class (Typeable e, Show e) => Exception e
- Chiasma.Prelude: class Fractional a => Floating a
- Chiasma.Prelude: class Foldable (t :: Type -> Type)
- Chiasma.Prelude: class Num a => Fractional a
- Chiasma.Prelude: class Functor (f :: Type -> Type)
- Chiasma.Prelude: class Generic a
- Chiasma.Prelude: class Hashable a
- Chiasma.Prelude: class (Real a, Enum a) => Integral a
- Chiasma.Prelude: class IsLabel (x :: Symbol) a
- Chiasma.Prelude: class IsList l
- Chiasma.Prelude: class IsString a
- Chiasma.Prelude: class KnownNat (n :: Nat)
- Chiasma.Prelude: class LazyStrict l s | l -> s, s -> l
- Chiasma.Prelude: class Applicative m => Monad (m :: Type -> Type)
- Chiasma.Prelude: class Monad m => MonadFail (m :: Type -> Type)
- Chiasma.Prelude: class Monad m => MonadIO (m :: Type -> Type)
- Chiasma.Prelude: class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type)
- Chiasma.Prelude: class Monad m => MonadReader r (m :: Type -> Type) | m -> r
- Chiasma.Prelude: class Monad m => MonadState s (m :: Type -> Type) | m -> s
- Chiasma.Prelude: class MonadTrans (t :: Type -> Type -> Type -> Type)
- Chiasma.Prelude: class Semigroup a => Monoid a
- Chiasma.Prelude: class NFData a
- Chiasma.Prelude: class Num a
- Chiasma.Prelude: class One x where {
- Chiasma.Prelude: class Eq a => Ord a
- Chiasma.Prelude: class Read a
- Chiasma.Prelude: class (Num a, Ord a) => Real a
- Chiasma.Prelude: class (RealFrac a, Floating a) => RealFloat a
- Chiasma.Prelude: class (Real a, Fractional a) => RealFrac a
- Chiasma.Prelude: class Semigroup a
- Chiasma.Prelude: class Show a
- Chiasma.Prelude: class ToLText a
- Chiasma.Prelude: class ToString a
- Chiasma.Prelude: class ToText a
- Chiasma.Prelude: class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
- Chiasma.Prelude: class Typeable (a :: k)
- Chiasma.Prelude: coerce :: forall (k :: RuntimeRep) (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b
- Chiasma.Prelude: compare :: Ord a => a -> a -> Ordering
- Chiasma.Prelude: comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- Chiasma.Prelude: comparisonEquivalence :: Comparison a -> Equivalence a
- Chiasma.Prelude: concat :: Foldable t => t [a] -> [a]
- Chiasma.Prelude: concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- Chiasma.Prelude: const :: a -> b -> a
- Chiasma.Prelude: contramap :: Contravariant f => (a -> b) -> f b -> f a
- Chiasma.Prelude: cos :: Floating a => a -> a
- Chiasma.Prelude: cosh :: Floating a => a -> a
- Chiasma.Prelude: currentCallStack :: IO [String]
- Chiasma.Prelude: curry :: ((a, b) -> c) -> a -> b -> c
- Chiasma.Prelude: cycle :: [a] -> [a]
- Chiasma.Prelude: cycle1 :: Semigroup m => m -> m
- Chiasma.Prelude: data Bool
- Chiasma.Prelude: data Bug
- Chiasma.Prelude: data ByteString
- Chiasma.Prelude: data CallStack
- Chiasma.Prelude: data Char
- Chiasma.Prelude: data Constraint
- Chiasma.Prelude: data Double
- Chiasma.Prelude: data Either a b
- Chiasma.Prelude: data Float
- Chiasma.Prelude: data Handle
- Chiasma.Prelude: data HashMap k v
- Chiasma.Prelude: data HashSet a
- Chiasma.Prelude: data IO a
- Chiasma.Prelude: data IOMode
- Chiasma.Prelude: data IORef a
- Chiasma.Prelude: data IdentityT (f :: k -> Type) (a :: k)
- Chiasma.Prelude: data Int
- Chiasma.Prelude: data Int16
- Chiasma.Prelude: data Int32
- Chiasma.Prelude: data Int64
- Chiasma.Prelude: data Int8
- Chiasma.Prelude: data IntMap a
- Chiasma.Prelude: data IntSet
- Chiasma.Prelude: data Integer
- Chiasma.Prelude: data MVar a
- Chiasma.Prelude: data Map k a
- Chiasma.Prelude: data Maybe a
- Chiasma.Prelude: data Nat
- Chiasma.Prelude: data Natural
- Chiasma.Prelude: data NonEmpty a
- Chiasma.Prelude: data Ordering
- Chiasma.Prelude: data Proxy (t :: k)
- Chiasma.Prelude: data Ratio a
- Chiasma.Prelude: data STM a
- Chiasma.Prelude: data Seq a
- Chiasma.Prelude: data Set a
- Chiasma.Prelude: data ShortByteString
- Chiasma.Prelude: data SomeException
- Chiasma.Prelude: data SomeNat
- Chiasma.Prelude: data TMVar a
- Chiasma.Prelude: data TVar a
- Chiasma.Prelude: data Text
- Chiasma.Prelude: data Undefined
- Chiasma.Prelude: data UnicodeException
- Chiasma.Prelude: data Void
- Chiasma.Prelude: data Word
- Chiasma.Prelude: data Word16
- Chiasma.Prelude: data Word32
- Chiasma.Prelude: data Word64
- Chiasma.Prelude: data Word8
- Chiasma.Prelude: data WrappedMonoid m
- Chiasma.Prelude: dbg :: Monad m => Text -> m ()
- Chiasma.Prelude: dbgm :: Monad m => Show a => m a -> m a
- Chiasma.Prelude: dbgs :: Monad m => Show a => a -> m ()
- Chiasma.Prelude: decodeFloat :: RealFloat a => a -> (Integer, Int)
- Chiasma.Prelude: decodeUtf8 :: ConvertUtf8 a b => b -> a
- Chiasma.Prelude: decodeUtf8' :: ByteString -> Either UnicodeException Text
- Chiasma.Prelude: decodeUtf8Strict :: ConvertUtf8 a b => b -> Either UnicodeException a
- Chiasma.Prelude: decodeUtf8With :: OnDecodeError -> ByteString -> Text
- Chiasma.Prelude: deepseq :: NFData a => a -> b -> b
- Chiasma.Prelude: def :: Default a => a
- Chiasma.Prelude: defaultComparison :: Ord a => Comparison a
- Chiasma.Prelude: defaultEquivalence :: Eq a => Equivalence a
- Chiasma.Prelude: denominator :: Ratio a -> a
- Chiasma.Prelude: die :: MonadIO m => String -> m a
- Chiasma.Prelude: displayException :: Exception e => e -> String
- Chiasma.Prelude: div :: Integral a => a -> a -> a
- Chiasma.Prelude: divMod :: Integral a => a -> a -> (a, a)
- Chiasma.Prelude: drop :: Int -> [a] -> [a]
- Chiasma.Prelude: dropWhile :: (a -> Bool) -> [a] -> [a]
- Chiasma.Prelude: either :: (a -> c) -> (b -> c) -> Either a b -> c
- Chiasma.Prelude: elem :: (Foldable f, DisallowElem f, Eq a) => a -> f a -> Bool
- Chiasma.Prelude: empty :: Alternative f => f a
- Chiasma.Prelude: encodeFloat :: RealFloat a => Integer -> Int -> a
- Chiasma.Prelude: encodeUtf8 :: ConvertUtf8 a b => a -> b
- Chiasma.Prelude: enumFrom :: Enum a => a -> [a]
- Chiasma.Prelude: enumFromThen :: Enum a => a -> a -> [a]
- Chiasma.Prelude: enumFromThenTo :: Enum a => a -> a -> a -> [a]
- Chiasma.Prelude: enumFromTo :: Enum a => a -> a -> [a]
- Chiasma.Prelude: error :: forall (r :: RuntimeRep) (a :: TYPE r) t. (HasCallStack, IsText t) => t -> a
- Chiasma.Prelude: etaReaderT :: forall r (m :: Type -> Type) a. ReaderT r m a -> ReaderT r m a
- Chiasma.Prelude: evalState :: State s a -> s -> a
- Chiasma.Prelude: evalStateT :: Monad m => StateT s m a -> s -> m a
- Chiasma.Prelude: evaluateNF :: (NFData a, MonadIO m) => a -> m a
- Chiasma.Prelude: evaluateNF_ :: (NFData a, MonadIO m) => a -> m ()
- Chiasma.Prelude: evaluateWHNF :: MonadIO m => a -> m a
- Chiasma.Prelude: evaluateWHNF_ :: MonadIO m => a -> m ()
- Chiasma.Prelude: evaluatingState :: s -> State s a -> a
- Chiasma.Prelude: evaluatingStateT :: Functor f => s -> StateT s f a -> f a
- Chiasma.Prelude: even :: Integral a => a -> Bool
- Chiasma.Prelude: exceptToMaybeT :: forall (m :: Type -> Type) e a. Functor m => ExceptT e m a -> MaybeT m a
- Chiasma.Prelude: execState :: State s a -> s -> s
- Chiasma.Prelude: execStateT :: Monad m => StateT s m a -> s -> m s
- Chiasma.Prelude: executingState :: s -> State s a -> s
- Chiasma.Prelude: executingStateT :: Functor f => s -> StateT s f a -> f s
- Chiasma.Prelude: exitFailure :: MonadIO m => m a
- Chiasma.Prelude: exitSuccess :: MonadIO m => m a
- Chiasma.Prelude: exitWith :: MonadIO m => ExitCode -> m a
- Chiasma.Prelude: exp :: Floating a => a -> a
- Chiasma.Prelude: fail :: MonadFail m => String -> m a
- Chiasma.Prelude: filter :: (a -> Bool) -> [a] -> [a]
- Chiasma.Prelude: filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- Chiasma.Prelude: find :: Foldable t => (a -> Bool) -> t a -> Maybe a
- Chiasma.Prelude: first :: Bifunctor p => (a -> b) -> p a c -> p b c
- Chiasma.Prelude: fix :: (a -> a) -> a
- Chiasma.Prelude: flap :: Functor f => f (a -> b) -> a -> f b
- Chiasma.Prelude: flip :: (a -> b -> c) -> b -> a -> c
- Chiasma.Prelude: flipfoldl' :: Foldable f => (a -> b -> b) -> b -> f a -> b
- Chiasma.Prelude: floatDigits :: RealFloat a => a -> Int
- Chiasma.Prelude: floatRadix :: RealFloat a => a -> Integer
- Chiasma.Prelude: floatRange :: RealFloat a => a -> (Int, Int)
- Chiasma.Prelude: floor :: (RealFrac a, Integral b) => a -> b
- Chiasma.Prelude: fmap :: Functor f => (a -> b) -> f a -> f b
- Chiasma.Prelude: fold :: (Foldable t, Monoid m) => t m -> m
- Chiasma.Prelude: foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
- Chiasma.Prelude: foldMap' :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
- Chiasma.Prelude: foldMapA :: (Semigroup b, Monoid b, Applicative m, Foldable f) => (a -> m b) -> f a -> m b
- Chiasma.Prelude: foldMapM :: (Monoid b, Monad m, Foldable f) => (a -> m b) -> f a -> m b
- Chiasma.Prelude: foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Chiasma.Prelude: foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
- Chiasma.Prelude: foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- Chiasma.Prelude: foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
- Chiasma.Prelude: forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- Chiasma.Prelude: forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- Chiasma.Prelude: for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- Chiasma.Prelude: force :: NFData a => a -> a
- Chiasma.Prelude: forever :: Applicative f => f a -> f b
- Chiasma.Prelude: fromEnum :: Enum a => a -> Int
- Chiasma.Prelude: fromException :: Exception e => SomeException -> Maybe e
- Chiasma.Prelude: fromInteger :: Num a => Integer -> a
- Chiasma.Prelude: fromIntegral :: (Integral a, Num b) => a -> b
- Chiasma.Prelude: fromLabel :: IsLabel x a => a
- Chiasma.Prelude: fromLazy :: LazyStrict l s => l -> s
- Chiasma.Prelude: fromLeft :: a -> Either a b -> a
- Chiasma.Prelude: fromList :: IsList l => [Item l] -> l
- Chiasma.Prelude: fromListN :: IsList l => Int -> [Item l] -> l
- Chiasma.Prelude: fromMaybe :: a -> Maybe a -> a
- Chiasma.Prelude: fromRational :: Fractional a => Rational -> a
- Chiasma.Prelude: fromRight :: b -> Either a b -> b
- Chiasma.Prelude: fromShort :: ShortByteString -> ByteString
- Chiasma.Prelude: fromStrict :: LazyStrict l s => s -> l
- Chiasma.Prelude: fromString :: IsString a => String -> a
- Chiasma.Prelude: fst :: (a, b) -> a
- Chiasma.Prelude: gcd :: Integral a => a -> a -> a
- Chiasma.Prelude: genericDrop :: Integral i => i -> [a] -> [a]
- Chiasma.Prelude: genericLength :: Num i => [a] -> i
- Chiasma.Prelude: genericReplicate :: Integral i => i -> a -> [a]
- Chiasma.Prelude: genericSplitAt :: Integral i => i -> [a] -> ([a], [a])
- Chiasma.Prelude: genericTake :: Integral i => i -> [a] -> [a]
- Chiasma.Prelude: getCallStack :: CallStack -> [([Char], SrcLoc)]
- Chiasma.Prelude: getLine :: MonadIO m => m Text
- Chiasma.Prelude: getStackTrace :: IO (Maybe [Location])
- Chiasma.Prelude: group :: Eq a => [a] -> [[a]]
- Chiasma.Prelude: guard :: Alternative f => Bool -> f ()
- Chiasma.Prelude: guardM :: MonadPlus m => m Bool -> m ()
- Chiasma.Prelude: guarded :: Alternative f => (a -> Bool) -> a -> f a
- Chiasma.Prelude: hashNub :: (Eq a, Hashable a) => [a] -> [a]
- Chiasma.Prelude: hashWithSalt :: Hashable a => Int -> a -> Int
- Chiasma.Prelude: head :: IsNonEmpty f a a "head" => f a -> a
- Chiasma.Prelude: id :: a -> a
- Chiasma.Prelude: identity :: a -> a
- Chiasma.Prelude: ifM :: Monad m => m Bool -> m a -> m a -> m a
- Chiasma.Prelude: infix 4 >=
- Chiasma.Prelude: infix 9 !!?
- Chiasma.Prelude: infixl 0 `on`
- Chiasma.Prelude: infixl 1 <&>
- Chiasma.Prelude: infixl 3 <|>
- Chiasma.Prelude: infixl 4 <<$>>
- Chiasma.Prelude: infixl 6 `xor`
- Chiasma.Prelude: infixl 7 *
- Chiasma.Prelude: infixr 0 ?:
- Chiasma.Prelude: infixr 1 =<<
- Chiasma.Prelude: infixr 2 ||
- Chiasma.Prelude: infixr 3 &&
- Chiasma.Prelude: infixr 5 :|
- Chiasma.Prelude: infixr 6 <>
- Chiasma.Prelude: infixr 8 <$$>
- Chiasma.Prelude: infixr 9 `Compose`
- Chiasma.Prelude: init :: IsNonEmpty f a [a] "init" => f a -> [a]
- Chiasma.Prelude: inits :: [a] -> [[a]]
- Chiasma.Prelude: integerToBounded :: (Integral a, Bounded a) => Integer -> Maybe a
- Chiasma.Prelude: integerToNatural :: Integer -> Maybe Natural
- Chiasma.Prelude: intercalate :: [a] -> [[a]] -> [a]
- Chiasma.Prelude: intersperse :: a -> [a] -> [a]
- Chiasma.Prelude: isDenormalized :: RealFloat a => a -> Bool
- Chiasma.Prelude: isEmptyTMVar :: TMVar a -> STM Bool
- Chiasma.Prelude: isIEEE :: RealFloat a => a -> Bool
- Chiasma.Prelude: isInfinite :: RealFloat a => a -> Bool
- Chiasma.Prelude: isJust :: Maybe a -> Bool
- Chiasma.Prelude: isLeft :: Either a b -> Bool
- Chiasma.Prelude: isNaN :: RealFloat a => a -> Bool
- Chiasma.Prelude: isNegativeZero :: RealFloat a => a -> Bool
- Chiasma.Prelude: isNothing :: Maybe a -> Bool
- Chiasma.Prelude: isPrefixOf :: Eq a => [a] -> [a] -> Bool
- Chiasma.Prelude: isRight :: Either a b -> Bool
- Chiasma.Prelude: iterate :: (a -> a) -> a -> [a]
- Chiasma.Prelude: join :: Monad m => m (m a) -> m a
- Chiasma.Prelude: last :: IsNonEmpty f a a "last" => f a -> a
- Chiasma.Prelude: lcm :: Integral a => a -> a -> a
- Chiasma.Prelude: leftToMaybe :: Either l r -> Maybe l
- Chiasma.Prelude: lefts :: [Either a b] -> [a]
- Chiasma.Prelude: length :: Foldable t => t a -> Int
- Chiasma.Prelude: lenientDecode :: OnDecodeError
- Chiasma.Prelude: lift :: (MonadTrans t, Monad m) => m a -> t m a
- Chiasma.Prelude: liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
- Chiasma.Prelude: liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- Chiasma.Prelude: liftIO :: MonadIO m => IO a -> m a
- Chiasma.Prelude: lines :: IsText t "lines" => t -> [t]
- Chiasma.Prelude: listToMaybe :: [a] -> Maybe a
- Chiasma.Prelude: logBase :: Floating a => a -> a -> a
- Chiasma.Prelude: makeClassy :: Name -> DecsQ
- Chiasma.Prelude: many :: Alternative f => f a -> f [a]
- Chiasma.Prelude: map :: (a -> b) -> [a] -> [b]
- Chiasma.Prelude: mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- Chiasma.Prelude: mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- Chiasma.Prelude: mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- Chiasma.Prelude: mapLeft :: (a -> c) -> Either a b -> Either c b
- Chiasma.Prelude: mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
- Chiasma.Prelude: mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- Chiasma.Prelude: mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- Chiasma.Prelude: mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]
- Chiasma.Prelude: mappend :: Monoid a => a -> a -> a
- Chiasma.Prelude: max :: Ord a => a -> a -> a
- Chiasma.Prelude: maxBound :: Bounded a => a
- Chiasma.Prelude: maxInt :: Int
- Chiasma.Prelude: maybe :: b -> (a -> b) -> Maybe a -> b
- Chiasma.Prelude: maybeToExceptT :: forall (m :: Type -> Type) e a. Functor m => e -> MaybeT m a -> ExceptT e m a
- Chiasma.Prelude: maybeToLeft :: r -> Maybe l -> Either l r
- Chiasma.Prelude: maybeToList :: Maybe a -> [a]
- Chiasma.Prelude: maybeToMonoid :: Monoid m => Maybe m -> m
- Chiasma.Prelude: maybeToRight :: l -> Maybe r -> Either l r
- Chiasma.Prelude: mconcat :: Monoid a => [a] -> a
- Chiasma.Prelude: mempty :: Monoid a => a
- Chiasma.Prelude: memptyIfFalse :: Monoid m => Bool -> m -> m
- Chiasma.Prelude: memptyIfTrue :: Monoid m => Bool -> m -> m
- Chiasma.Prelude: mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- Chiasma.Prelude: min :: Ord a => a -> a -> a
- Chiasma.Prelude: minBound :: Bounded a => a
- Chiasma.Prelude: minInt :: Int
- Chiasma.Prelude: mkWeakTMVar :: TMVar a -> IO () -> IO (Weak (TMVar a))
- Chiasma.Prelude: mod :: Integral a => a -> a -> a
- Chiasma.Prelude: modify' :: MonadState s m => (s -> s) -> m ()
- Chiasma.Prelude: modifyIORef :: MonadIO m => IORef a -> (a -> a) -> m ()
- Chiasma.Prelude: modifyIORef' :: MonadIO m => IORef a -> (a -> a) -> m ()
- Chiasma.Prelude: modifyTVar' :: TVar a -> (a -> a) -> STM ()
- Chiasma.Prelude: mplus :: MonadPlus m => m a -> m a -> m a
- Chiasma.Prelude: mtimesDefault :: (Integral b, Monoid a) => b -> a -> a
- Chiasma.Prelude: mzero :: MonadPlus m => m a
- Chiasma.Prelude: natVal :: forall (n :: Nat) proxy. KnownNat n => proxy n -> Natural
- Chiasma.Prelude: negate :: Num a => a -> a
- Chiasma.Prelude: newEmptyMVar :: MonadIO m => m (MVar a)
- Chiasma.Prelude: newEmptyTMVar :: STM (TMVar a)
- Chiasma.Prelude: newEmptyTMVarIO :: MonadIO m => m (TMVar a)
- Chiasma.Prelude: newIORef :: MonadIO m => a -> m (IORef a)
- Chiasma.Prelude: newMVar :: MonadIO m => a -> m (MVar a)
- Chiasma.Prelude: newTMVar :: a -> STM (TMVar a)
- Chiasma.Prelude: newTMVarIO :: MonadIO m => a -> m (TMVar a)
- Chiasma.Prelude: newTVar :: a -> STM (TVar a)
- Chiasma.Prelude: newTVarIO :: MonadIO m => a -> m (TVar a)
- Chiasma.Prelude: newtype All
- Chiasma.Prelude: newtype Alt (f :: k -> Type) (a :: k)
- Chiasma.Prelude: newtype Any
- Chiasma.Prelude: newtype Ap (f :: k -> Type) (a :: k)
- Chiasma.Prelude: newtype Comparison a
- Chiasma.Prelude: newtype Compose (f :: k -> Type) (g :: k1 -> k) (a :: k1)
- Chiasma.Prelude: newtype Const a (b :: k)
- Chiasma.Prelude: newtype Down a
- Chiasma.Prelude: newtype Dual a
- Chiasma.Prelude: newtype Endo a
- Chiasma.Prelude: newtype Equivalence a
- Chiasma.Prelude: newtype ExceptT e (m :: Type -> Type) a
- Chiasma.Prelude: newtype First a
- Chiasma.Prelude: newtype Identity a
- Chiasma.Prelude: newtype Last a
- Chiasma.Prelude: newtype MaybeT (m :: Type -> Type) a
- Chiasma.Prelude: newtype Op a b
- Chiasma.Prelude: newtype Option a
- Chiasma.Prelude: newtype Predicate a
- Chiasma.Prelude: newtype Product a
- Chiasma.Prelude: newtype ReaderT r (m :: Type -> Type) a
- Chiasma.Prelude: newtype StateT s (m :: Type -> Type) a
- Chiasma.Prelude: newtype Sum a
- Chiasma.Prelude: newtype ZipList a
- Chiasma.Prelude: nonEmpty :: [a] -> Maybe (NonEmpty a)
- Chiasma.Prelude: not :: Bool -> Bool
- Chiasma.Prelude: notElem :: (Foldable f, DisallowElem f, Eq a) => a -> f a -> Bool
- Chiasma.Prelude: null :: Foldable t => t a -> Bool
- Chiasma.Prelude: numerator :: Ratio a -> a
- Chiasma.Prelude: odd :: Integral a => a -> Bool
- Chiasma.Prelude: on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- Chiasma.Prelude: one :: One x => OneItem x -> x
- Chiasma.Prelude: optional :: Alternative f => f a -> f (Maybe a)
- Chiasma.Prelude: or :: Foldable t => t Bool -> Bool
- Chiasma.Prelude: orM :: (Foldable f, Monad m) => f (m Bool) -> m Bool
- Chiasma.Prelude: ord :: Char -> Int
- Chiasma.Prelude: ordNub :: Ord a => [a] -> [a]
- Chiasma.Prelude: otherwise :: Bool
- Chiasma.Prelude: partitionEithers :: [Either a b] -> ([a], [b])
- Chiasma.Prelude: pass :: Applicative f => f ()
- Chiasma.Prelude: pattern Exc :: Exception e => e -> SomeException
- Chiasma.Prelude: permutations :: [a] -> [[a]]
- Chiasma.Prelude: phantom :: (Functor f, Contravariant f) => f a -> f b
- Chiasma.Prelude: pi :: Floating a => a
- Chiasma.Prelude: pred :: Enum a => a -> a
- Chiasma.Prelude: prettyCallStack :: CallStack -> String
- Chiasma.Prelude: prettySrcLoc :: SrcLoc -> String
- Chiasma.Prelude: print :: forall a m. (MonadIO m, Show a) => a -> m ()
- Chiasma.Prelude: product :: forall a f. (Foldable f, Num a) => f a -> a
- Chiasma.Prelude: properFraction :: (RealFrac a, Integral b) => a -> (b, a)
- Chiasma.Prelude: pure :: Applicative f => a -> f a
- Chiasma.Prelude: putBS :: MonadIO m => ByteString -> m ()
- Chiasma.Prelude: putBSLn :: MonadIO m => ByteString -> m ()
- Chiasma.Prelude: putLBS :: MonadIO m => LByteString -> m ()
- Chiasma.Prelude: putLBSLn :: MonadIO m => LByteString -> m ()
- Chiasma.Prelude: putLText :: MonadIO m => LText -> m ()
- Chiasma.Prelude: putLTextLn :: MonadIO m => LText -> m ()
- Chiasma.Prelude: putMVar :: MonadIO m => MVar a -> a -> m ()
- Chiasma.Prelude: putStr :: MonadIO m => String -> m ()
- Chiasma.Prelude: putStrLn :: MonadIO m => String -> m ()
- Chiasma.Prelude: putTMVar :: TMVar a -> a -> STM ()
- Chiasma.Prelude: putText :: MonadIO m => Text -> m ()
- Chiasma.Prelude: putTextLn :: MonadIO m => Text -> m ()
- Chiasma.Prelude: quot :: Integral a => a -> a -> a
- Chiasma.Prelude: quotRem :: Integral a => a -> a -> (a, a)
- Chiasma.Prelude: readEither :: Read a => String -> Either Text a
- Chiasma.Prelude: readFile :: MonadIO m => FilePath -> m String
- Chiasma.Prelude: readFileBS :: MonadIO m => FilePath -> m ByteString
- Chiasma.Prelude: readFileLBS :: MonadIO m => FilePath -> m LByteString
- Chiasma.Prelude: readFileLText :: MonadIO m => FilePath -> m LText
- Chiasma.Prelude: readFileText :: MonadIO m => FilePath -> m Text
- Chiasma.Prelude: readIORef :: MonadIO m => IORef a -> m a
- Chiasma.Prelude: readMVar :: MonadIO m => MVar a -> m a
- Chiasma.Prelude: readMaybe :: Read a => String -> Maybe a
- Chiasma.Prelude: readTMVar :: TMVar a -> STM a
- Chiasma.Prelude: readTVar :: TVar a -> STM a
- Chiasma.Prelude: readTVarIO :: MonadIO m => TVar a -> m a
- Chiasma.Prelude: reader :: MonadReader r m => (r -> a) -> m a
- Chiasma.Prelude: reads :: Read a => ReadS a
- Chiasma.Prelude: realToFrac :: (Real a, Fractional b) => a -> b
- Chiasma.Prelude: recip :: Fractional a => a -> a
- Chiasma.Prelude: rem :: Integral a => a -> a -> a
- Chiasma.Prelude: repeat :: a -> [a]
- Chiasma.Prelude: replicate :: Int -> a -> [a]
- Chiasma.Prelude: replicateM :: Applicative m => Int -> m a -> m [a]
- Chiasma.Prelude: replicateM_ :: Applicative m => Int -> m a -> m ()
- Chiasma.Prelude: return :: Monad m => a -> m a
- Chiasma.Prelude: reverse :: [a] -> [a]
- Chiasma.Prelude: rightToMaybe :: Either l r -> Maybe r
- Chiasma.Prelude: rights :: [Either a b] -> [b]
- Chiasma.Prelude: rnf :: NFData a => a -> ()
- Chiasma.Prelude: round :: (RealFrac a, Integral b) => a -> b
- Chiasma.Prelude: runExceptT :: ExceptT e m a -> m (Either e a)
- Chiasma.Prelude: runReader :: Reader r a -> r -> a
- Chiasma.Prelude: runState :: State s a -> s -> (a, s)
- Chiasma.Prelude: scanl :: (b -> a -> b) -> b -> [a] -> [b]
- Chiasma.Prelude: scanl' :: (b -> a -> b) -> b -> [a] -> [b]
- Chiasma.Prelude: scanl1 :: (a -> a -> a) -> [a] -> [a]
- Chiasma.Prelude: scanr :: (a -> b -> b) -> b -> [a] -> [b]
- Chiasma.Prelude: scanr1 :: (a -> a -> a) -> [a] -> [a]
- Chiasma.Prelude: sconcat :: Semigroup a => NonEmpty a -> a
- Chiasma.Prelude: second :: Bifunctor p => (b -> c) -> p a b -> p a c
- Chiasma.Prelude: seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b
- Chiasma.Prelude: sequence :: (Traversable t, Monad m) => t (m a) -> m (t a)
- Chiasma.Prelude: sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
- Chiasma.Prelude: sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
- Chiasma.Prelude: sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- Chiasma.Prelude: show :: forall b a. (Show a, IsString b) => a -> b
- Chiasma.Prelude: showStackTrace :: IO (Maybe String)
- Chiasma.Prelude: signum :: Num a => a -> a
- Chiasma.Prelude: sin :: Floating a => a -> a
- Chiasma.Prelude: sinh :: Floating a => a -> a
- Chiasma.Prelude: snd :: (a, b) -> b
- Chiasma.Prelude: some :: Alternative f => f a -> f [a]
- Chiasma.Prelude: someNatVal :: Natural -> SomeNat
- Chiasma.Prelude: sort :: Ord a => [a] -> [a]
- Chiasma.Prelude: sortBy :: (a -> a -> Ordering) -> [a] -> [a]
- Chiasma.Prelude: sortNub :: Ord a => [a] -> [a]
- Chiasma.Prelude: sortOn :: Ord b => (a -> b) -> [a] -> [a]
- Chiasma.Prelude: sortWith :: Ord b => (a -> b) -> [a] -> [a]
- Chiasma.Prelude: splitAt :: Int -> [a] -> ([a], [a])
- Chiasma.Prelude: sqrt :: Floating a => a -> a
- Chiasma.Prelude: stderr :: Handle
- Chiasma.Prelude: stdin :: Handle
- Chiasma.Prelude: stdout :: Handle
- Chiasma.Prelude: stimes :: (Semigroup a, Integral b) => b -> a -> a
- Chiasma.Prelude: stimesIdempotent :: Integral b => b -> a -> a
- Chiasma.Prelude: stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
- Chiasma.Prelude: stimesMonoid :: (Integral b, Monoid a) => b -> a -> a
- Chiasma.Prelude: strictDecode :: OnDecodeError
- Chiasma.Prelude: subsequences :: [a] -> [[a]]
- Chiasma.Prelude: subtract :: Num a => a -> a -> a
- Chiasma.Prelude: succ :: Enum a => a -> a
- Chiasma.Prelude: sum :: forall a f. (Foldable f, Num a) => f a -> a
- Chiasma.Prelude: swap :: (a, b) -> (b, a)
- Chiasma.Prelude: swapMVar :: MonadIO m => MVar a -> a -> m a
- Chiasma.Prelude: swapTMVar :: TMVar a -> a -> STM a
- Chiasma.Prelude: tail :: IsNonEmpty f a [a] "tail" => f a -> [a]
- Chiasma.Prelude: tails :: [a] -> [[a]]
- Chiasma.Prelude: take :: Int -> [a] -> [a]
- Chiasma.Prelude: takeMVar :: MonadIO m => MVar a -> m a
- Chiasma.Prelude: takeTMVar :: TMVar a -> STM a
- Chiasma.Prelude: takeWhile :: (a -> Bool) -> [a] -> [a]
- Chiasma.Prelude: tan :: Floating a => a -> a
- Chiasma.Prelude: tanh :: Floating a => a -> a
- Chiasma.Prelude: throwSTM :: Exception e => e -> STM a
- Chiasma.Prelude: toEnum :: Enum a => Int -> a
- Chiasma.Prelude: toException :: Exception e => e -> SomeException
- Chiasma.Prelude: toInteger :: Integral a => a -> Integer
- Chiasma.Prelude: toIntegralSized :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b
- Chiasma.Prelude: toLText :: ToLText a => a -> LText
- Chiasma.Prelude: toLazy :: LazyStrict l s => s -> l
- Chiasma.Prelude: toList :: Foldable t => t a -> [a]
- Chiasma.Prelude: toRational :: Real a => a -> Rational
- Chiasma.Prelude: toShort :: ByteString -> ShortByteString
- Chiasma.Prelude: toStrict :: LazyStrict l s => l -> s
- Chiasma.Prelude: toString :: ToString a => a -> String
- Chiasma.Prelude: toText :: ToText a => a -> Text
- Chiasma.Prelude: trace :: String -> a -> a
- Chiasma.Prelude: traceId :: String -> String
- Chiasma.Prelude: traceM :: Applicative f => String -> f ()
- Chiasma.Prelude: traceShow :: Show a => a -> b -> b
- Chiasma.Prelude: traceShowId :: Show a => a -> a
- Chiasma.Prelude: traceShowM :: (Show a, Applicative f) => a -> f ()
- Chiasma.Prelude: transpose :: [[a]] -> [[a]]
- Chiasma.Prelude: traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
- Chiasma.Prelude: traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
- Chiasma.Prelude: truncate :: (RealFrac a, Integral b) => a -> b
- Chiasma.Prelude: tryPutMVar :: MonadIO m => MVar a -> a -> m Bool
- Chiasma.Prelude: tryPutTMVar :: TMVar a -> a -> STM Bool
- Chiasma.Prelude: tryReadMVar :: MonadIO m => MVar a -> m (Maybe a)
- Chiasma.Prelude: tryReadTMVar :: TMVar a -> STM (Maybe a)
- Chiasma.Prelude: tryTakeMVar :: MonadIO m => MVar a -> m (Maybe a)
- Chiasma.Prelude: tryTakeTMVar :: TMVar a -> STM (Maybe a)
- Chiasma.Prelude: tuple :: Applicative f => f a -> f b -> f (a, b)
- Chiasma.Prelude: type FilePath = String
- Chiasma.Prelude: type HasCallStack = ?callStack :: CallStack
- Chiasma.Prelude: type LByteString = ByteString
- Chiasma.Prelude: type LText = Text
- Chiasma.Prelude: type OnDecodeError = OnError Word8 Char
- Chiasma.Prelude: type OnError a b = String -> Maybe a -> Maybe b
- Chiasma.Prelude: type Rational = Ratio Integer
- Chiasma.Prelude: type Reader r = ReaderT r Identity
- Chiasma.Prelude: type State s = StateT s Identity
- Chiasma.Prelude: type String = [Char]
- Chiasma.Prelude: type family OneItem x;
- Chiasma.Prelude: uncons :: [a] -> Maybe (a, [a])
- Chiasma.Prelude: uncurry :: (a -> b -> c) -> (a, b) -> c
- Chiasma.Prelude: undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a
- Chiasma.Prelude: unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
- Chiasma.Prelude: unit :: Applicative f => f ()
- Chiasma.Prelude: unless :: Applicative f => Bool -> f () -> f ()
- Chiasma.Prelude: unlessM :: Monad m => m Bool -> m () -> m ()
- Chiasma.Prelude: unlines :: IsText t "unlines" => [t] -> t
- Chiasma.Prelude: unsafeLogAnd :: Text -> b -> b
- Chiasma.Prelude: unsafeLogS :: Show a => a -> a
- Chiasma.Prelude: unsafeLogSAnd :: Show a => a -> b -> b
- Chiasma.Prelude: unstableNub :: (Eq a, Hashable a) => [a] -> [a]
- Chiasma.Prelude: unwords :: IsText t "unwords" => [t] -> t
- Chiasma.Prelude: unzip :: [(a, b)] -> ([a], [b])
- Chiasma.Prelude: unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- Chiasma.Prelude: usingReader :: r -> Reader r a -> a
- Chiasma.Prelude: usingReaderT :: r -> ReaderT r m a -> m a
- Chiasma.Prelude: usingState :: s -> State s a -> (a, s)
- Chiasma.Prelude: usingStateT :: s -> StateT s m a -> m (a, s)
- Chiasma.Prelude: vacuous :: Functor f => f Void -> f a
- Chiasma.Prelude: viaNonEmpty :: (NonEmpty a -> b) -> [a] -> Maybe b
- Chiasma.Prelude: void :: Functor f => f a -> f ()
- Chiasma.Prelude: when :: Applicative f => Bool -> f () -> f ()
- Chiasma.Prelude: whenJust :: Applicative f => Maybe a -> (a -> f ()) -> f ()
- Chiasma.Prelude: whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
- Chiasma.Prelude: whenLeft :: Applicative f => a -> Either l r -> (l -> f a) -> f a
- Chiasma.Prelude: whenLeftM :: Monad m => a -> m (Either l r) -> (l -> m a) -> m a
- Chiasma.Prelude: whenLeftM_ :: Monad m => m (Either l r) -> (l -> m ()) -> m ()
- Chiasma.Prelude: whenLeft_ :: Applicative f => Either l r -> (l -> f ()) -> f ()
- Chiasma.Prelude: whenM :: Monad m => m Bool -> m () -> m ()
- Chiasma.Prelude: whenNotNull :: Applicative f => [a] -> (NonEmpty a -> f ()) -> f ()
- Chiasma.Prelude: whenNotNullM :: Monad m => m [a] -> (NonEmpty a -> m ()) -> m ()
- Chiasma.Prelude: whenNothing :: Applicative f => Maybe a -> f a -> f a
- Chiasma.Prelude: whenNothingM :: Monad m => m (Maybe a) -> m a -> m a
- Chiasma.Prelude: whenNothingM_ :: Monad m => m (Maybe a) -> m () -> m ()
- Chiasma.Prelude: whenNothing_ :: Applicative f => Maybe a -> f () -> f ()
- Chiasma.Prelude: whenRight :: Applicative f => a -> Either l r -> (r -> f a) -> f a
- Chiasma.Prelude: whenRightM :: Monad m => a -> m (Either l r) -> (r -> m a) -> m a
- Chiasma.Prelude: whenRightM_ :: Monad m => m (Either l r) -> (r -> m ()) -> m ()
- Chiasma.Prelude: whenRight_ :: Applicative f => Either l r -> (r -> f ()) -> f ()
- Chiasma.Prelude: withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
- Chiasma.Prelude: withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a
- Chiasma.Prelude: withReader :: (r' -> r) -> Reader r a -> Reader r' a
- Chiasma.Prelude: withReaderT :: forall r' r (m :: Type -> Type) a. (r' -> r) -> ReaderT r m a -> ReaderT r' m a
- Chiasma.Prelude: withState :: (s -> s) -> State s a -> State s a
- Chiasma.Prelude: words :: IsText t "words" => t -> [t]
- Chiasma.Prelude: writeFile :: MonadIO m => FilePath -> String -> m ()
- Chiasma.Prelude: writeFileBS :: MonadIO m => FilePath -> ByteString -> m ()
- Chiasma.Prelude: writeFileLBS :: MonadIO m => FilePath -> LByteString -> m ()
- Chiasma.Prelude: writeFileLText :: MonadIO m => FilePath -> LText -> m ()
- Chiasma.Prelude: writeFileText :: MonadIO m => FilePath -> Text -> m ()
- Chiasma.Prelude: writeIORef :: MonadIO m => IORef a -> a -> m ()
- Chiasma.Prelude: writeTVar :: TVar a -> a -> STM ()
- Chiasma.Prelude: xor :: Bits a => a -> a -> a
- Chiasma.Prelude: zip :: [a] -> [b] -> [(a, b)]
- Chiasma.Prelude: zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- Chiasma.Prelude: zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- Chiasma.Prelude: zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- Chiasma.Prelude: zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- Chiasma.Prelude: }
- Chiasma.Test.File: fixture :: MonadIO m => Text -> FilePath -> m FilePath
- Chiasma.Test.File: tempDir :: MonadIO m => Text -> FilePath -> m FilePath
- Chiasma.Test.File: tempDirIO :: Text -> FilePath -> IO FilePath
- Chiasma.Test.Screenshot: loadScreenshot :: MonadIO m => FilePath -> m (Maybe Text)
- Chiasma.Test.Screenshot: recordScreenshot :: MonadFree TmuxThunk m => MonadIO m => FilePath -> Int -> m ()
- Chiasma.Test.Screenshot: screenshot :: MonadFree TmuxThunk m => MonadIO m => Bool -> FilePath -> Text -> Int -> m (Maybe ([Text], [Text]))
- Chiasma.Test.Screenshot: storeScreenshot :: MonadIO m => FilePath -> [Text] -> m ()
- Chiasma.Test.Screenshot: takeScreenshot :: MonadFree TmuxThunk m => MonadIO m => Int -> m [Text]
- Chiasma.Test.Screenshot: testScreenshot :: MonadFree TmuxThunk m => MonadIO m => FilePath -> Int -> m (Maybe ([Text], [Text]))
- Chiasma.Test.Tmux: Terminal :: Handle -> Pty -> Terminal
- Chiasma.Test.Tmux: TmuxTestConf :: Int -> Int -> Int -> Bool -> TmuxTestConf
- Chiasma.Test.Tmux: [$sel:ttcFontSize:TmuxTestConf] :: TmuxTestConf -> Int
- Chiasma.Test.Tmux: [$sel:ttcGui:TmuxTestConf] :: TmuxTestConf -> Bool
- Chiasma.Test.Tmux: [$sel:ttcHeight:TmuxTestConf] :: TmuxTestConf -> Int
- Chiasma.Test.Tmux: [$sel:ttcWidth:TmuxTestConf] :: TmuxTestConf -> Int
- Chiasma.Test.Tmux: data Terminal
- Chiasma.Test.Tmux: data TmuxTestConf
- Chiasma.Test.Tmux: instance Data.Default.Class.Default Chiasma.Test.Tmux.TmuxTestConf
- Chiasma.Test.Tmux: instance GHC.Classes.Eq Chiasma.Test.Tmux.TmuxTestConf
- Chiasma.Test.Tmux: instance GHC.Show.Show Chiasma.Test.Tmux.TmuxTestConf
- Chiasma.Test.Tmux: killPid :: Integral a => a -> IO ()
- Chiasma.Test.Tmux: killProcess :: TmuxNative -> Process () () () -> IO ()
- Chiasma.Test.Tmux: runAndKillTmux :: (TmuxNative -> IO a) -> TmuxNative -> Process () () () -> IO a
- Chiasma.Test.Tmux: sleep :: MonadIO f => Double -> f ()
- Chiasma.Test.Tmux: testTmuxProcessConfig :: TmuxTestConf -> FilePath -> FilePath -> Terminal -> IO (ProcessConfig () () ())
- Chiasma.Test.Tmux: tmuxGuiSpec :: (TmuxNative -> IO a) -> IO a
- Chiasma.Test.Tmux: tmuxSpec :: (TmuxNative -> IO a) -> IO a
- Chiasma.Test.Tmux: tmuxSpec' :: TmuxTestConf -> (TmuxNative -> IO a) -> IO a
- Chiasma.Test.Tmux: unsafeTerminal :: IO Terminal
- Chiasma.Test.Tmux: urxvtArgs :: Int -> Int -> Int -> [Text]
- Chiasma.Test.Tmux: usleep :: MonadIO f => Double -> f ()
- Chiasma.Test.Tmux: withTestTmux :: TmuxTestConf -> (TmuxNative -> IO a) -> FilePath -> IO a
- Chiasma.Ui.Data.Measure: [$sel:_vertical:MLayout] :: MLayout -> Bool
- Chiasma.Ui.Data.Measure: vertical :: HasMLayout c_avMv => Lens' c_avMv Bool
- Chiasma.Ui.Data.RenderableTree: [$sel:_vertical:RLayout] :: RLayout -> Bool
- Chiasma.Ui.Data.Tree: instance (GHC.Classes.Eq l, GHC.Classes.Eq p) => GHC.Classes.Eq (Chiasma.Ui.Data.Tree.Tree GHC.Base.NonEmpty l p)
- Chiasma.Ui.Data.Tree: instance (GHC.Classes.Eq l, GHC.Classes.Eq p) => GHC.Classes.Eq (Chiasma.Ui.Data.Tree.Tree [] l p)
- Chiasma.Ui.Data.Tree: instance (GHC.Show.Show l, GHC.Show.Show p) => GHC.Show.Show (Chiasma.Ui.Data.Tree.Tree GHC.Base.NonEmpty l p)
- Chiasma.Ui.Data.Tree: instance (GHC.Show.Show l, GHC.Show.Show p) => GHC.Show.Show (Chiasma.Ui.Data.Tree.Tree [] l p)
- Chiasma.Ui.Data.TreeModError: _AmbiguousLayout :: AsTreeModError r_aL47 => Prism' r_aL47 (Ident, Int)
- Chiasma.Ui.Data.TreeModError: _AmbiguousPane :: AsTreeModError r_aL47 => Prism' r_aL47 (Ident, Int)
- Chiasma.Ui.Data.TreeModError: _LayoutExists :: AsTreeModError r_aL47 => Prism' r_aL47 LayoutView
- Chiasma.Ui.Data.TreeModError: _LayoutMissing :: AsTreeModError r_aL47 => Prism' r_aL47 Ident
- Chiasma.Ui.Data.TreeModError: _NoTrees :: AsTreeModError r_aL47 => Prism' r_aL47 ()
- Chiasma.Ui.Data.TreeModError: _PaneExists :: AsTreeModError r_aL47 => Prism' r_aL47 PaneView
- Chiasma.Ui.Data.TreeModError: _PaneMissing :: AsTreeModError r_aL47 => Prism' r_aL47 Ident
- Chiasma.Ui.Data.TreeModError: _TreeModError :: AsTreeModError r_aL47 => Prism' r_aL47 TreeModError
- Chiasma.Ui.Data.TreeModError: class AsTreeModError r_aL47
- Chiasma.Ui.Data.TreeModError: instance Chiasma.Ui.Data.TreeModError.AsTreeModError Chiasma.Ui.Data.TreeModError.TreeModError
- Chiasma.Ui.Data.TreeModError: instance Data.DeepPrisms.DeepPrisms Chiasma.Ui.Data.TreeModError.TreeModError Chiasma.Ui.Data.TreeModError.TreeModError
- Chiasma.Ui.Data.View: [$sel:vertical:Layout] :: Layout -> Bool
- Chiasma.Ui.Data.View: _vertical :: HasLayout c_aDkB => Lens' c_aDkB Bool
+ Chiasma: data Codec (command :: Type -> Type) (i :: Type) (o :: Type) :: Effect
+ Chiasma: data TmuxApi (command :: Type -> Type) :: Effect
+ Chiasma: type NativeCodec command = Codec command TmuxRequest TmuxResponse
+ Chiasma: type NativeCodecE command = NativeCodec command !! CodecError
+ Chiasma: type NativeCommandCodec = NativeCodec TmuxCommand
+ Chiasma: type NativeCommandCodecE = NativeCodecE TmuxCommand
+ Chiasma: type Tmux = TmuxApi TmuxCommand
+ Chiasma.Class.CmdArgs: arg :: Maybe Text -> [Text]
+ Chiasma.Class.CmdArgs: class CmdArgs a
+ Chiasma.Class.CmdArgs: cmdArgs :: CmdArgs a => a -> [Text]
+ Chiasma.Class.CmdArgs: envVars :: Map Text Text -> [Text]
+ Chiasma.Class.CmdArgs: flag :: [Text] -> Bool -> [Text]
+ Chiasma.Class.CmdArgs: flag1 :: Text -> Bool -> [Text]
+ Chiasma.Class.CmdArgs: identOption :: Text -> Maybe Ident -> [Text]
+ Chiasma.Class.CmdArgs: option :: Text -> Maybe Text -> [Text]
+ Chiasma.Class.CmdArgs: optionArgs :: CmdArgs a => Maybe a -> [Text]
+ Chiasma.Class.CmdArgs: optionArgsWith :: CmdArgs a => Text -> Maybe a -> [Text]
+ Chiasma.Class.CmdArgs: optionWith :: Text -> (a -> Text) -> Maybe a -> [Text]
+ Chiasma.Codec: checkRemainder :: ([Text], b) -> Either DecodeFailure b
+ Chiasma.Codec: multi :: TmuxCodec a => [Text] -> Either DecodeError [a]
+ Chiasma.Codec: single :: TmuxCodec a => [Text] -> Either DecodeError a
+ Chiasma.Codec: trim :: Text -> Text
+ Chiasma.Codec: tryTrim :: Text -> Maybe Text
+ Chiasma.Codec.Data: [$sel:paneLeft:Pane] :: Pane -> Int
+ Chiasma.Codec.Data: [$sel:paneTop:Pane] :: Pane -> Int
+ Chiasma.Codec.Data: [$sel:sessionName:Session] :: Session -> Text
+ Chiasma.Codec.Data.Client: Client :: ClientId -> Bool -> SessionId -> Client
+ Chiasma.Codec.Data.Client: [$sel:clientControlMode:Client] :: Client -> Bool
+ Chiasma.Codec.Data.Client: [$sel:clientName:Client] :: Client -> ClientId
+ Chiasma.Codec.Data.Client: [$sel:sessionId:Client] :: Client -> SessionId
+ Chiasma.Codec.Data.Client: data Client
+ Chiasma.Codec.Data.Client: instance Chiasma.Codec.TmuxCodec Chiasma.Codec.Data.Client.Client
+ Chiasma.Codec.Data.Client: instance GHC.Classes.Eq Chiasma.Codec.Data.Client.Client
+ Chiasma.Codec.Data.Client: instance GHC.Generics.Generic Chiasma.Codec.Data.Client.Client
+ Chiasma.Codec.Data.Client: instance GHC.Show.Show Chiasma.Codec.Data.Client.Client
+ Chiasma.Codec.Data.Pane: [$sel:paneLeft:Pane] :: Pane -> Int
+ Chiasma.Codec.Data.Pane: [$sel:paneTop:Pane] :: Pane -> Int
+ Chiasma.Codec.Data.Session: [$sel:sessionName:Session] :: Session -> Text
+ Chiasma.Codec.Decode: dataDecode :: TmuxDataDecode f => [Text] -> Either DecodeFailure ([Text], f a)
+ Chiasma.Codec.Decode: instance Chiasma.Codec.Decode.TmuxPrimDecode Chiasma.Data.TmuxId.ClientId
+ Chiasma.Codec.Query: dataQuery :: TmuxDataQuery f => [Text]
+ Chiasma.Command.Session: clientForSession :: SessionId -> [Client] -> Maybe Client
+ Chiasma.Command.Session: switchClient :: Members [Tmux, Stop TmuxError] r => SessionId -> SessionId -> Sem r ()
+ Chiasma.Command.Window: splitWindowInDir :: Member Tmux r => Path Abs Dir -> WindowId -> Sem r Pane
+ Chiasma.Data.Axis: Horizontal :: Axis
+ Chiasma.Data.Axis: Vertical :: Axis
+ Chiasma.Data.Axis: data Axis
+ Chiasma.Data.Axis: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.Axis.Axis
+ Chiasma.Data.Axis: instance Data.Data.Data Chiasma.Data.Axis.Axis
+ Chiasma.Data.Axis: instance Data.Default.Class.Default Chiasma.Data.Axis.Axis
+ Chiasma.Data.Axis: instance GHC.Classes.Eq Chiasma.Data.Axis.Axis
+ Chiasma.Data.Axis: instance GHC.Show.Show Chiasma.Data.Axis.Axis
+ Chiasma.Data.Axis: instance Prettyprinter.Internal.Pretty Chiasma.Data.Axis.Axis
+ Chiasma.Data.Axis: vertical :: Axis -> Bool
+ Chiasma.Data.CapturePaneParams: Buffer :: Text -> CaptureOutput
+ Chiasma.Data.CapturePaneParams: CaptureLine :: Int -> CaptureLine
+ Chiasma.Data.CapturePaneParams: CapturePaneParams :: Maybe CaptureOutput -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Maybe CaptureLine -> Maybe CaptureLine -> Target -> Bool -> Bool -> CapturePaneParams
+ Chiasma.Data.CapturePaneParams: Edge :: CaptureLine
+ Chiasma.Data.CapturePaneParams: Stdout :: CaptureOutput
+ Chiasma.Data.CapturePaneParams: [$sel:alternate:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:endLine:CapturePaneParams] :: CapturePaneParams -> Maybe CaptureLine
+ Chiasma.Data.CapturePaneParams: [$sel:escapeSequences:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:incomplete:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:joinWrapped:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:octal:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:output:CapturePaneParams] :: CapturePaneParams -> Maybe CaptureOutput
+ Chiasma.Data.CapturePaneParams: [$sel:quiet:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:startLine:CapturePaneParams] :: CapturePaneParams -> Maybe CaptureLine
+ Chiasma.Data.CapturePaneParams: [$sel:stripBlank:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:stripTrailingWs:CapturePaneParams] :: CapturePaneParams -> Bool
+ Chiasma.Data.CapturePaneParams: [$sel:target:CapturePaneParams] :: CapturePaneParams -> Target
+ Chiasma.Data.CapturePaneParams: data CaptureLine
+ Chiasma.Data.CapturePaneParams: data CaptureOutput
+ Chiasma.Data.CapturePaneParams: data CapturePaneParams
+ Chiasma.Data.CapturePaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.CapturePaneParams.CaptureLine
+ Chiasma.Data.CapturePaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.CapturePaneParams.CaptureOutput
+ Chiasma.Data.CapturePaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.CapturePaneParams.CapturePaneParams
+ Chiasma.Data.CapturePaneParams: instance Data.Default.Class.Default Chiasma.Data.CapturePaneParams.CapturePaneParams
+ Chiasma.Data.CapturePaneParams: instance GHC.Classes.Eq Chiasma.Data.CapturePaneParams.CaptureLine
+ Chiasma.Data.CapturePaneParams: instance GHC.Classes.Eq Chiasma.Data.CapturePaneParams.CaptureOutput
+ Chiasma.Data.CapturePaneParams: instance GHC.Classes.Eq Chiasma.Data.CapturePaneParams.CapturePaneParams
+ Chiasma.Data.CapturePaneParams: instance GHC.Show.Show Chiasma.Data.CapturePaneParams.CaptureLine
+ Chiasma.Data.CapturePaneParams: instance GHC.Show.Show Chiasma.Data.CapturePaneParams.CaptureOutput
+ Chiasma.Data.CapturePaneParams: instance GHC.Show.Show Chiasma.Data.CapturePaneParams.CapturePaneParams
+ Chiasma.Data.CodecError: CodecError :: TmuxRequest -> DecodeError -> CodecError
+ Chiasma.Data.CodecError: data CodecError
+ Chiasma.Data.CodecError: instance GHC.Classes.Eq Chiasma.Data.CodecError.CodecError
+ Chiasma.Data.CodecError: instance GHC.Show.Show Chiasma.Data.CodecError.CodecError
+ Chiasma.Data.CopyModeParams: CopyModeParams :: Bool -> Bool -> Bool -> Target -> CopyModeParams
+ Chiasma.Data.CopyModeParams: [$sel:exitBottom:CopyModeParams] :: CopyModeParams -> Bool
+ Chiasma.Data.CopyModeParams: [$sel:mouseDrag:CopyModeParams] :: CopyModeParams -> Bool
+ Chiasma.Data.CopyModeParams: [$sel:scrollUp:CopyModeParams] :: CopyModeParams -> Bool
+ Chiasma.Data.CopyModeParams: [$sel:target:CopyModeParams] :: CopyModeParams -> Target
+ Chiasma.Data.CopyModeParams: data CopyModeParams
+ Chiasma.Data.CopyModeParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.CopyModeParams.CopyModeParams
+ Chiasma.Data.CopyModeParams: instance Data.Default.Class.Default Chiasma.Data.CopyModeParams.CopyModeParams
+ Chiasma.Data.CopyModeParams: instance GHC.Classes.Eq Chiasma.Data.CopyModeParams.CopyModeParams
+ Chiasma.Data.CopyModeParams: instance GHC.Show.Show Chiasma.Data.CopyModeParams.CopyModeParams
+ Chiasma.Data.DecodeError: BoolParsingFailure :: Text -> DecodeFailure
+ Chiasma.Data.DecodeError: DecodeError :: [Text] -> DecodeFailure -> DecodeError
+ Chiasma.Data.DecodeError: IntParsingFailure :: Text -> DecodeFailure
+ Chiasma.Data.DecodeError: ParseFailure :: Text -> ParseError -> DecodeFailure
+ Chiasma.Data.DecodeError: TargetMissing :: DecodeFailure
+ Chiasma.Data.DecodeError: TooFewFields :: DecodeFailure
+ Chiasma.Data.DecodeError: TooManyFields :: [Text] -> DecodeFailure
+ Chiasma.Data.DecodeError: TooManyRecords :: [Text] -> DecodeFailure
+ Chiasma.Data.DecodeError: [$sel:failure:DecodeError] :: DecodeError -> DecodeFailure
+ Chiasma.Data.DecodeError: [$sel:output:DecodeError] :: DecodeError -> [Text]
+ Chiasma.Data.DecodeError: data DecodeError
+ Chiasma.Data.DecodeError: data DecodeFailure
+ Chiasma.Data.DecodeError: instance GHC.Classes.Eq Chiasma.Data.DecodeError.DecodeError
+ Chiasma.Data.DecodeError: instance GHC.Classes.Eq Chiasma.Data.DecodeError.DecodeFailure
+ Chiasma.Data.DecodeError: instance GHC.Show.Show Chiasma.Data.DecodeError.DecodeError
+ Chiasma.Data.DecodeError: instance GHC.Show.Show Chiasma.Data.DecodeError.DecodeFailure
+ Chiasma.Data.Direction: Down :: Direction
+ Chiasma.Data.Direction: Left :: Direction
+ Chiasma.Data.Direction: Right :: Direction
+ Chiasma.Data.Direction: Up :: Direction
+ Chiasma.Data.Direction: data Direction
+ Chiasma.Data.Direction: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.Direction.Direction
+ Chiasma.Data.Direction: instance GHC.Classes.Eq Chiasma.Data.Direction.Direction
+ Chiasma.Data.Direction: instance GHC.Show.Show Chiasma.Data.Direction.Direction
+ Chiasma.Data.Event: WindowClosed :: WindowId -> Event
+ Chiasma.Data.Event: data Event
+ Chiasma.Data.Event: instance GHC.Classes.Eq Chiasma.Data.Event.Event
+ Chiasma.Data.Event: instance GHC.Show.Show Chiasma.Data.Event.Event
+ Chiasma.Data.KillPaneParams: KillPaneParams :: Bool -> Target -> KillPaneParams
+ Chiasma.Data.KillPaneParams: [$sel:allbut:KillPaneParams] :: KillPaneParams -> Bool
+ Chiasma.Data.KillPaneParams: [$sel:target:KillPaneParams] :: KillPaneParams -> Target
+ Chiasma.Data.KillPaneParams: data KillPaneParams
+ Chiasma.Data.KillPaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.KillPaneParams.KillPaneParams
+ Chiasma.Data.KillPaneParams: instance Data.Default.Class.Default Chiasma.Data.KillPaneParams.KillPaneParams
+ Chiasma.Data.KillPaneParams: instance GHC.Classes.Eq Chiasma.Data.KillPaneParams.KillPaneParams
+ Chiasma.Data.KillPaneParams: instance GHC.Show.Show Chiasma.Data.KillPaneParams.KillPaneParams
+ Chiasma.Data.LayoutError: LayoutError :: Text -> LayoutError
+ Chiasma.Data.LayoutError: [$sel:unLayoutError:LayoutError] :: LayoutError -> Text
+ Chiasma.Data.LayoutError: instance Data.String.IsString Chiasma.Data.LayoutError.LayoutError
+ Chiasma.Data.LayoutError: instance GHC.Classes.Eq Chiasma.Data.LayoutError.LayoutError
+ Chiasma.Data.LayoutError: instance GHC.Generics.Generic Chiasma.Data.LayoutError.LayoutError
+ Chiasma.Data.LayoutError: instance GHC.Show.Show Chiasma.Data.LayoutError.LayoutError
+ Chiasma.Data.LayoutError: newtype LayoutError
+ Chiasma.Data.PaneSelection: All :: PaneSelection
+ Chiasma.Data.PaneSelection: InSession :: Target -> PaneSelection
+ Chiasma.Data.PaneSelection: InWindow :: Target -> PaneSelection
+ Chiasma.Data.PaneSelection: data PaneSelection
+ Chiasma.Data.PaneSelection: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.PaneSelection.PaneSelection
+ Chiasma.Data.PaneSelection: instance Data.Default.Class.Default Chiasma.Data.PaneSelection.PaneSelection
+ Chiasma.Data.PaneSelection: instance GHC.Classes.Eq Chiasma.Data.PaneSelection.PaneSelection
+ Chiasma.Data.PaneSelection: instance GHC.Show.Show Chiasma.Data.PaneSelection.PaneSelection
+ Chiasma.Data.Panes: [Find] :: PaneId -> Panes p (Maybe p)
+ Chiasma.Data.Panes: [First] :: PaneSelection -> Panes p p
+ Chiasma.Data.Panes: [Get] :: PaneId -> Panes p p
+ Chiasma.Data.Panes: [List] :: PaneSelection -> Panes p [p]
+ Chiasma.Data.Panes: [One] :: PaneSelection -> Panes p p
+ Chiasma.Data.Panes: data Panes (p :: Type) (a :: Type) :: Type
+ Chiasma.Data.Panes: decode :: forall p a. TmuxCodec p => TmuxResponse -> Panes p a -> Either DecodeError a
+ Chiasma.Data.Panes: encode :: forall p a. TmuxCodec p => Panes p a -> TmuxRequest
+ Chiasma.Data.Panes: paneById :: TmuxCodec p => PaneId -> [Text] -> Either DecodeError (Maybe p)
+ Chiasma.Data.Panes: query :: forall p a. TmuxCodec p => Panes p a -> TmuxQuery
+ Chiasma.Data.Panes: request :: Panes p a -> TmuxQuery -> TmuxRequest
+ Chiasma.Data.Panes: sameId :: PaneId -> WithPaneId a -> Maybe a
+ Chiasma.Data.Panes: selection :: Panes p a -> PaneSelection
+ Chiasma.Data.Panes: type TmuxPanes p = TmuxApi (Panes p)
+ Chiasma.Data.PipePaneParams: PipePaneParams :: Bool -> Bool -> Bool -> Target -> Maybe Text -> PipePaneParams
+ Chiasma.Data.PipePaneParams: [$sel:command:PipePaneParams] :: PipePaneParams -> Maybe Text
+ Chiasma.Data.PipePaneParams: [$sel:input:PipePaneParams] :: PipePaneParams -> Bool
+ Chiasma.Data.PipePaneParams: [$sel:onlyNew:PipePaneParams] :: PipePaneParams -> Bool
+ Chiasma.Data.PipePaneParams: [$sel:output:PipePaneParams] :: PipePaneParams -> Bool
+ Chiasma.Data.PipePaneParams: [$sel:target:PipePaneParams] :: PipePaneParams -> Target
+ Chiasma.Data.PipePaneParams: data PipePaneParams
+ Chiasma.Data.PipePaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.PipePaneParams.PipePaneParams
+ Chiasma.Data.PipePaneParams: instance Data.Default.Class.Default Chiasma.Data.PipePaneParams.PipePaneParams
+ Chiasma.Data.PipePaneParams: instance GHC.Classes.Eq Chiasma.Data.PipePaneParams.PipePaneParams
+ Chiasma.Data.PipePaneParams: instance GHC.Show.Show Chiasma.Data.PipePaneParams.PipePaneParams
+ Chiasma.Data.ProcessError: Terminated :: Text -> ProcessError
+ Chiasma.Data.ProcessError: data ProcessError
+ Chiasma.Data.ProcessError: instance GHC.Classes.Eq Chiasma.Data.ProcessError.ProcessError
+ Chiasma.Data.ProcessError: instance GHC.Show.Show Chiasma.Data.ProcessError.ProcessError
+ Chiasma.Data.ReceiveEvent: [ReceiveEvent] :: ReceiveEvent Event
+ Chiasma.Data.ReceiveEvent: data ReceiveEvent :: Type -> Type
+ Chiasma.Data.RenderError: Codec :: CodecError -> RenderError
+ Chiasma.Data.RenderError: Layout :: LayoutError -> RenderError
+ Chiasma.Data.ResizePaneParams: Adjustment :: Maybe Direction -> Maybe Int -> Adjustment
+ Chiasma.Data.ResizePaneParams: ResizeAbsolute :: Axis -> Int -> ResizeAbsolute
+ Chiasma.Data.ResizePaneParams: ResizePaneParams :: Maybe ResizeAbsolute -> Maybe Adjustment -> Bool -> Bool -> Target -> ResizePaneParams
+ Chiasma.Data.ResizePaneParams: [$sel:absolute:ResizePaneParams] :: ResizePaneParams -> Maybe ResizeAbsolute
+ Chiasma.Data.ResizePaneParams: [$sel:adjustment:ResizePaneParams] :: ResizePaneParams -> Maybe Adjustment
+ Chiasma.Data.ResizePaneParams: [$sel:mouse:ResizePaneParams] :: ResizePaneParams -> Bool
+ Chiasma.Data.ResizePaneParams: [$sel:target:ResizePaneParams] :: ResizePaneParams -> Target
+ Chiasma.Data.ResizePaneParams: [$sel:zoom:ResizePaneParams] :: ResizePaneParams -> Bool
+ Chiasma.Data.ResizePaneParams: data Adjustment
+ Chiasma.Data.ResizePaneParams: data ResizeAbsolute
+ Chiasma.Data.ResizePaneParams: data ResizePaneParams
+ Chiasma.Data.ResizePaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.ResizePaneParams.Adjustment
+ Chiasma.Data.ResizePaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.ResizePaneParams.ResizeAbsolute
+ Chiasma.Data.ResizePaneParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.ResizePaneParams.ResizePaneParams
+ Chiasma.Data.ResizePaneParams: instance Data.Default.Class.Default Chiasma.Data.ResizePaneParams.ResizePaneParams
+ Chiasma.Data.ResizePaneParams: instance GHC.Classes.Eq Chiasma.Data.ResizePaneParams.Adjustment
+ Chiasma.Data.ResizePaneParams: instance GHC.Classes.Eq Chiasma.Data.ResizePaneParams.ResizeAbsolute
+ Chiasma.Data.ResizePaneParams: instance GHC.Classes.Eq Chiasma.Data.ResizePaneParams.ResizePaneParams
+ Chiasma.Data.ResizePaneParams: instance GHC.Show.Show Chiasma.Data.ResizePaneParams.Adjustment
+ Chiasma.Data.ResizePaneParams: instance GHC.Show.Show Chiasma.Data.ResizePaneParams.ResizeAbsolute
+ Chiasma.Data.ResizePaneParams: instance GHC.Show.Show Chiasma.Data.ResizePaneParams.ResizePaneParams
+ Chiasma.Data.SelectParams: DisableInput :: SelectInput
+ Chiasma.Data.SelectParams: EnableInput :: SelectInput
+ Chiasma.Data.SelectParams: SelectMark :: SelectMark
+ Chiasma.Data.SelectParams: SelectParams :: Maybe Direction -> Bool -> Maybe SelectInput -> Maybe SelectMark -> Maybe Text -> Target -> SelectParams
+ Chiasma.Data.SelectParams: SelectUnmark :: SelectMark
+ Chiasma.Data.SelectParams: [$sel:input:SelectParams] :: SelectParams -> Maybe SelectInput
+ Chiasma.Data.SelectParams: [$sel:last:SelectParams] :: SelectParams -> Bool
+ Chiasma.Data.SelectParams: [$sel:mark:SelectParams] :: SelectParams -> Maybe SelectMark
+ Chiasma.Data.SelectParams: [$sel:neighbor:SelectParams] :: SelectParams -> Maybe Direction
+ Chiasma.Data.SelectParams: [$sel:target:SelectParams] :: SelectParams -> Target
+ Chiasma.Data.SelectParams: [$sel:title:SelectParams] :: SelectParams -> Maybe Text
+ Chiasma.Data.SelectParams: data SelectInput
+ Chiasma.Data.SelectParams: data SelectMark
+ Chiasma.Data.SelectParams: data SelectParams
+ Chiasma.Data.SelectParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SelectParams.SelectInput
+ Chiasma.Data.SelectParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SelectParams.SelectMark
+ Chiasma.Data.SelectParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SelectParams.SelectParams
+ Chiasma.Data.SelectParams: instance Data.Default.Class.Default Chiasma.Data.SelectParams.SelectParams
+ Chiasma.Data.SelectParams: instance GHC.Classes.Eq Chiasma.Data.SelectParams.SelectInput
+ Chiasma.Data.SelectParams: instance GHC.Classes.Eq Chiasma.Data.SelectParams.SelectMark
+ Chiasma.Data.SelectParams: instance GHC.Classes.Eq Chiasma.Data.SelectParams.SelectParams
+ Chiasma.Data.SelectParams: instance GHC.Show.Show Chiasma.Data.SelectParams.SelectInput
+ Chiasma.Data.SelectParams: instance GHC.Show.Show Chiasma.Data.SelectParams.SelectMark
+ Chiasma.Data.SelectParams: instance GHC.Show.Show Chiasma.Data.SelectParams.SelectParams
+ Chiasma.Data.SelectWindowParams: SelectWindowParams :: Bool -> Bool -> Bool -> Bool -> Target -> SelectWindowParams
+ Chiasma.Data.SelectWindowParams: [$sel:last:SelectWindowParams] :: SelectWindowParams -> Bool
+ Chiasma.Data.SelectWindowParams: [$sel:next:SelectWindowParams] :: SelectWindowParams -> Bool
+ Chiasma.Data.SelectWindowParams: [$sel:previous:SelectWindowParams] :: SelectWindowParams -> Bool
+ Chiasma.Data.SelectWindowParams: [$sel:target:SelectWindowParams] :: SelectWindowParams -> Target
+ Chiasma.Data.SelectWindowParams: [$sel:toggle:SelectWindowParams] :: SelectWindowParams -> Bool
+ Chiasma.Data.SelectWindowParams: data SelectWindowParams
+ Chiasma.Data.SelectWindowParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SelectWindowParams.SelectWindowParams
+ Chiasma.Data.SelectWindowParams: instance Data.Default.Class.Default Chiasma.Data.SelectWindowParams.SelectWindowParams
+ Chiasma.Data.SelectWindowParams: instance GHC.Classes.Eq Chiasma.Data.SelectWindowParams.SelectWindowParams
+ Chiasma.Data.SelectWindowParams: instance GHC.Show.Show Chiasma.Data.SelectWindowParams.SelectWindowParams
+ Chiasma.Data.SendKeysParams: Key :: Text -> Key
+ Chiasma.Data.SendKeysParams: Lit :: Text -> Key
+ Chiasma.Data.SendKeysParams: SendKeysParams :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Maybe Int -> [Key] -> Target -> SendKeysParams
+ Chiasma.Data.SendKeysParams: [$sel:copyMode:SendKeysParams] :: SendKeysParams -> Bool
+ Chiasma.Data.SendKeysParams: [$sel:enter:SendKeysParams] :: SendKeysParams -> Bool
+ Chiasma.Data.SendKeysParams: [$sel:hex:SendKeysParams] :: SendKeysParams -> Bool
+ Chiasma.Data.SendKeysParams: [$sel:keys:SendKeysParams] :: SendKeysParams -> [Key]
+ Chiasma.Data.SendKeysParams: [$sel:literal:SendKeysParams] :: SendKeysParams -> Bool
+ Chiasma.Data.SendKeysParams: [$sel:mouse:SendKeysParams] :: SendKeysParams -> Bool
+ Chiasma.Data.SendKeysParams: [$sel:repeat:SendKeysParams] :: SendKeysParams -> Maybe Int
+ Chiasma.Data.SendKeysParams: [$sel:reset:SendKeysParams] :: SendKeysParams -> Bool
+ Chiasma.Data.SendKeysParams: [$sel:target:SendKeysParams] :: SendKeysParams -> Target
+ Chiasma.Data.SendKeysParams: data Key
+ Chiasma.Data.SendKeysParams: data SendKeysParams
+ Chiasma.Data.SendKeysParams: escape :: Text -> Text
+ Chiasma.Data.SendKeysParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SendKeysParams.Key
+ Chiasma.Data.SendKeysParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SendKeysParams.SendKeysParams
+ Chiasma.Data.SendKeysParams: instance Data.Default.Class.Default Chiasma.Data.SendKeysParams.SendKeysParams
+ Chiasma.Data.SendKeysParams: instance Data.String.IsString Chiasma.Data.SendKeysParams.Key
+ Chiasma.Data.SendKeysParams: instance GHC.Classes.Eq Chiasma.Data.SendKeysParams.Key
+ Chiasma.Data.SendKeysParams: instance GHC.Classes.Eq Chiasma.Data.SendKeysParams.SendKeysParams
+ Chiasma.Data.SendKeysParams: instance GHC.Show.Show Chiasma.Data.SendKeysParams.Key
+ Chiasma.Data.SendKeysParams: instance GHC.Show.Show Chiasma.Data.SendKeysParams.SendKeysParams
+ Chiasma.Data.SessionGroupId: SessionGroupId :: Text -> SessionGroupId
+ Chiasma.Data.SessionGroupId: [$sel:unSessionGroupId:SessionGroupId] :: SessionGroupId -> Text
+ Chiasma.Data.SessionGroupId: instance Data.String.IsString Chiasma.Data.SessionGroupId.SessionGroupId
+ Chiasma.Data.SessionGroupId: instance GHC.Classes.Eq Chiasma.Data.SessionGroupId.SessionGroupId
+ Chiasma.Data.SessionGroupId: instance GHC.Generics.Generic Chiasma.Data.SessionGroupId.SessionGroupId
+ Chiasma.Data.SessionGroupId: instance GHC.Show.Show Chiasma.Data.SessionGroupId.SessionGroupId
+ Chiasma.Data.SessionGroupId: newtype SessionGroupId
+ Chiasma.Data.SessionParams: SessionParams :: Bool -> Bool -> Bool -> Bool -> Bool -> Maybe (Path Abs Dir) -> Map Text Text -> Maybe Ident -> Maybe Ident -> Maybe SessionGroupId -> Maybe Int -> Maybe Int -> Maybe Text -> SessionParams
+ Chiasma.Data.SessionParams: [$sel:attach:SessionParams] :: SessionParams -> Bool
+ Chiasma.Data.SessionParams: [$sel:command:SessionParams] :: SessionParams -> Maybe Text
+ Chiasma.Data.SessionParams: [$sel:cwd:SessionParams] :: SessionParams -> Maybe (Path Abs Dir)
+ Chiasma.Data.SessionParams: [$sel:defaultSize:SessionParams] :: SessionParams -> Bool
+ Chiasma.Data.SessionParams: [$sel:detach:SessionParams] :: SessionParams -> Bool
+ Chiasma.Data.SessionParams: [$sel:environment:SessionParams] :: SessionParams -> Map Text Text
+ Chiasma.Data.SessionParams: [$sel:exitClient:SessionParams] :: SessionParams -> Bool
+ Chiasma.Data.SessionParams: [$sel:height:SessionParams] :: SessionParams -> Maybe Int
+ Chiasma.Data.SessionParams: [$sel:name:SessionParams] :: SessionParams -> Maybe Ident
+ Chiasma.Data.SessionParams: [$sel:printInfo:SessionParams] :: SessionParams -> Bool
+ Chiasma.Data.SessionParams: [$sel:target:SessionParams] :: SessionParams -> Maybe SessionGroupId
+ Chiasma.Data.SessionParams: [$sel:width:SessionParams] :: SessionParams -> Maybe Int
+ Chiasma.Data.SessionParams: [$sel:windowName:SessionParams] :: SessionParams -> Maybe Ident
+ Chiasma.Data.SessionParams: data SessionParams
+ Chiasma.Data.SessionParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SessionParams.SessionParams
+ Chiasma.Data.SessionParams: instance Data.Default.Class.Default Chiasma.Data.SessionParams.SessionParams
+ Chiasma.Data.SessionParams: instance GHC.Classes.Eq Chiasma.Data.SessionParams.SessionParams
+ Chiasma.Data.SessionParams: instance GHC.Show.Show Chiasma.Data.SessionParams.SessionParams
+ Chiasma.Data.SplitParams: JoinPaneParams :: Maybe Axis -> Maybe SplitSize -> Bool -> Bool -> Maybe Target -> Target -> JoinPaneParams
+ Chiasma.Data.SplitParams: Percentage :: Int -> SplitSize
+ Chiasma.Data.SplitParams: SplitWindowParams :: Maybe Axis -> Maybe SplitSize -> Bool -> Bool -> Bool -> SplitWindowParams
+ Chiasma.Data.SplitParams: Units :: Int -> SplitSize
+ Chiasma.Data.SplitParams: [$sel:axis:JoinPaneParams] :: JoinPaneParams -> Maybe Axis
+ Chiasma.Data.SplitParams: [$sel:axis:SplitWindowParams] :: SplitWindowParams -> Maybe Axis
+ Chiasma.Data.SplitParams: [$sel:before:JoinPaneParams] :: JoinPaneParams -> Bool
+ Chiasma.Data.SplitParams: [$sel:before:SplitWindowParams] :: SplitWindowParams -> Bool
+ Chiasma.Data.SplitParams: [$sel:detach:JoinPaneParams] :: JoinPaneParams -> Bool
+ Chiasma.Data.SplitParams: [$sel:fullSize:SplitWindowParams] :: SplitWindowParams -> Bool
+ Chiasma.Data.SplitParams: [$sel:readStdin:SplitWindowParams] :: SplitWindowParams -> Bool
+ Chiasma.Data.SplitParams: [$sel:size:JoinPaneParams] :: JoinPaneParams -> Maybe SplitSize
+ Chiasma.Data.SplitParams: [$sel:size:SplitWindowParams] :: SplitWindowParams -> Maybe SplitSize
+ Chiasma.Data.SplitParams: [$sel:source:JoinPaneParams] :: JoinPaneParams -> Maybe Target
+ Chiasma.Data.SplitParams: [$sel:target:JoinPaneParams] :: JoinPaneParams -> Target
+ Chiasma.Data.SplitParams: data JoinPaneParams
+ Chiasma.Data.SplitParams: data SplitSize
+ Chiasma.Data.SplitParams: data SplitWindowParams
+ Chiasma.Data.SplitParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SplitParams.JoinPaneParams
+ Chiasma.Data.SplitParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SplitParams.SplitSize
+ Chiasma.Data.SplitParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.SplitParams.SplitWindowParams
+ Chiasma.Data.SplitParams: instance Data.Default.Class.Default Chiasma.Data.SplitParams.JoinPaneParams
+ Chiasma.Data.SplitParams: instance Data.Default.Class.Default Chiasma.Data.SplitParams.SplitWindowParams
+ Chiasma.Data.SplitParams: instance GHC.Classes.Eq Chiasma.Data.SplitParams.JoinPaneParams
+ Chiasma.Data.SplitParams: instance GHC.Classes.Eq Chiasma.Data.SplitParams.SplitSize
+ Chiasma.Data.SplitParams: instance GHC.Classes.Eq Chiasma.Data.SplitParams.SplitWindowParams
+ Chiasma.Data.SplitParams: instance GHC.Show.Show Chiasma.Data.SplitParams.JoinPaneParams
+ Chiasma.Data.SplitParams: instance GHC.Show.Show Chiasma.Data.SplitParams.SplitSize
+ Chiasma.Data.SplitParams: instance GHC.Show.Show Chiasma.Data.SplitParams.SplitWindowParams
+ Chiasma.Data.Target: Current :: Target
+ Chiasma.Data.Target: Pane :: PaneId -> Target
+ Chiasma.Data.Target: Session :: SessionId -> Target
+ Chiasma.Data.Target: Window :: WindowId -> Target
+ Chiasma.Data.Target: data Target
+ Chiasma.Data.Target: formatTarget :: [Text] -> Target -> [Text]
+ Chiasma.Data.Target: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.Target.Target
+ Chiasma.Data.Target: instance Data.Default.Class.Default Chiasma.Data.Target.Target
+ Chiasma.Data.Target: instance GHC.Classes.Eq Chiasma.Data.Target.Target
+ Chiasma.Data.Target: instance GHC.Show.Show Chiasma.Data.Target.Target
+ Chiasma.Data.TmuxCommand: [CapturePane] :: CapturePaneParams -> TmuxCommand [Text]
+ Chiasma.Data.TmuxCommand: [CopyMode] :: CopyModeParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [Fmap] :: (a -> b) -> TmuxCommand a -> TmuxCommand b
+ Chiasma.Data.TmuxCommand: [KillPane] :: KillPaneParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [KillServer] :: TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [ListClients] :: TmuxCommand [Client]
+ Chiasma.Data.TmuxCommand: [ListPanes] :: PaneSelection -> TmuxCommand [Pane]
+ Chiasma.Data.TmuxCommand: [ListSessions] :: TmuxCommand [Session]
+ Chiasma.Data.TmuxCommand: [ListWindows] :: WindowSelection -> TmuxCommand [Window]
+ Chiasma.Data.TmuxCommand: [MovePane] :: JoinPaneParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [NewSession] :: SessionParams -> TmuxCommand Session
+ Chiasma.Data.TmuxCommand: [NewWindow] :: WindowParams -> TmuxCommand Window
+ Chiasma.Data.TmuxCommand: [PipePane] :: PipePaneParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [ResizePane] :: ResizePaneParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [SelectPane] :: SelectParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [SelectWindow] :: SelectWindowParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [SendKeys] :: SendKeysParams -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: [SplitWindow] :: WindowParams -> SplitWindowParams -> TmuxCommand Pane
+ Chiasma.Data.TmuxCommand: [SwitchClient] :: ClientId -> Target -> TmuxCommand ()
+ Chiasma.Data.TmuxCommand: data TmuxCommand :: Type -> Type
+ Chiasma.Data.TmuxCommand: decode :: TmuxResponse -> TmuxCommand a -> Either DecodeError a
+ Chiasma.Data.TmuxCommand: encode :: TmuxCommand a -> TmuxRequest
+ Chiasma.Data.TmuxCommand: instance GHC.Base.Functor Chiasma.Data.TmuxCommand.TmuxCommand
+ Chiasma.Data.TmuxCommand: instance GHC.Show.Show (Chiasma.Data.TmuxCommand.TmuxCommand a)
+ Chiasma.Data.TmuxCommand: query :: forall a. TmuxCommand a -> Maybe TmuxQuery
+ Chiasma.Data.TmuxCommand: request :: TmuxCommand a -> Maybe TmuxQuery -> TmuxRequest
+ Chiasma.Data.TmuxError: DecodeFailed :: TmuxRequest -> DecodeError -> TmuxError
+ Chiasma.Data.TmuxError: NoClients :: TmuxError
+ Chiasma.Data.TmuxError: NoExe :: TmuxError
+ Chiasma.Data.TmuxError: RequestFailed :: TmuxRequest -> [Text] -> TmuxError
+ Chiasma.Data.TmuxError: codec :: CodecError -> TmuxError
+ Chiasma.Data.TmuxId: ClientId :: Text -> ClientId
+ Chiasma.Data.TmuxId: [$sel:unClientId:ClientId] :: ClientId -> Text
+ Chiasma.Data.TmuxId: [$sel:unTmuxIdPrefix:TmuxIdPrefix] :: TmuxIdPrefix a -> Text
+ Chiasma.Data.TmuxId: instance Data.String.IsString Chiasma.Data.TmuxId.ClientId
+ Chiasma.Data.TmuxId: instance GHC.Classes.Eq Chiasma.Data.TmuxId.ClientId
+ Chiasma.Data.TmuxId: instance GHC.Generics.Generic Chiasma.Data.TmuxId.ClientId
+ Chiasma.Data.TmuxId: instance GHC.Show.Show Chiasma.Data.TmuxId.ClientId
+ Chiasma.Data.TmuxId: instance Prettyprinter.Internal.Pretty Chiasma.Data.TmuxId.ClientId
+ Chiasma.Data.TmuxId: instance forall k (a :: k). Data.String.IsString (Chiasma.Data.TmuxId.TmuxIdPrefix a)
+ Chiasma.Data.TmuxId: instance forall k (a :: k). GHC.Classes.Eq (Chiasma.Data.TmuxId.TmuxIdPrefix a)
+ Chiasma.Data.TmuxId: instance forall k (a :: k). GHC.Generics.Generic (Chiasma.Data.TmuxId.TmuxIdPrefix a)
+ Chiasma.Data.TmuxId: instance forall k (a :: k). GHC.Show.Show (Chiasma.Data.TmuxId.TmuxIdPrefix a)
+ Chiasma.Data.TmuxId: newtype ClientId
+ Chiasma.Data.TmuxNative: TmuxNative :: Path Abs File -> Maybe (Path Abs File) -> TmuxNative
+ Chiasma.Data.TmuxNative: [$sel:executable:TmuxNative] :: TmuxNative -> Path Abs File
+ Chiasma.Data.TmuxNative: [$sel:tmuxServerSocket:TmuxNative] :: TmuxNative -> Maybe (Path Abs File)
+ Chiasma.Data.TmuxNative: data TmuxNative
+ Chiasma.Data.TmuxNative: instance GHC.Classes.Eq Chiasma.Data.TmuxNative.TmuxNative
+ Chiasma.Data.TmuxNative: instance GHC.Show.Show Chiasma.Data.TmuxNative.TmuxNative
+ Chiasma.Data.TmuxOutputBlock: EndError :: End
+ Chiasma.Data.TmuxOutputBlock: EndSuccess :: End
+ Chiasma.Data.TmuxOutputBlock: Error :: [Text] -> TmuxOutputBlock
+ Chiasma.Data.TmuxOutputBlock: Success :: [Text] -> TmuxOutputBlock
+ Chiasma.Data.TmuxOutputBlock: data End
+ Chiasma.Data.TmuxOutputBlock: data TmuxOutputBlock
+ Chiasma.Data.TmuxOutputBlock: instance GHC.Classes.Eq Chiasma.Data.TmuxOutputBlock.End
+ Chiasma.Data.TmuxOutputBlock: instance GHC.Classes.Eq Chiasma.Data.TmuxOutputBlock.TmuxOutputBlock
+ Chiasma.Data.TmuxOutputBlock: instance GHC.Show.Show Chiasma.Data.TmuxOutputBlock.End
+ Chiasma.Data.TmuxOutputBlock: instance GHC.Show.Show Chiasma.Data.TmuxOutputBlock.TmuxOutputBlock
+ Chiasma.Data.TmuxQuery: TmuxQuery :: Text -> TmuxQuery
+ Chiasma.Data.TmuxQuery: [$sel:unTmuxQuery:TmuxQuery] :: TmuxQuery -> Text
+ Chiasma.Data.TmuxQuery: instance Data.String.IsString Chiasma.Data.TmuxQuery.TmuxQuery
+ Chiasma.Data.TmuxQuery: instance GHC.Base.Monoid Chiasma.Data.TmuxQuery.TmuxQuery
+ Chiasma.Data.TmuxQuery: instance GHC.Base.Semigroup Chiasma.Data.TmuxQuery.TmuxQuery
+ Chiasma.Data.TmuxQuery: instance GHC.Classes.Eq Chiasma.Data.TmuxQuery.TmuxQuery
+ Chiasma.Data.TmuxQuery: instance GHC.Generics.Generic Chiasma.Data.TmuxQuery.TmuxQuery
+ Chiasma.Data.TmuxQuery: instance GHC.Show.Show Chiasma.Data.TmuxQuery.TmuxQuery
+ Chiasma.Data.TmuxQuery: newtype TmuxQuery
+ Chiasma.Data.TmuxRequest: TmuxRequest :: Text -> [Text] -> Maybe TmuxQuery -> TmuxRequest
+ Chiasma.Data.TmuxRequest: [$sel:args:TmuxRequest] :: TmuxRequest -> [Text]
+ Chiasma.Data.TmuxRequest: [$sel:cmd:TmuxRequest] :: TmuxRequest -> Text
+ Chiasma.Data.TmuxRequest: [$sel:query:TmuxRequest] :: TmuxRequest -> Maybe TmuxQuery
+ Chiasma.Data.TmuxRequest: cmdline :: TmuxRequest -> [Text]
+ Chiasma.Data.TmuxRequest: data TmuxRequest
+ Chiasma.Data.TmuxRequest: encode :: TmuxRequest -> ByteString
+ Chiasma.Data.TmuxRequest: instance GHC.Classes.Eq Chiasma.Data.TmuxRequest.TmuxRequest
+ Chiasma.Data.TmuxRequest: instance GHC.Show.Show Chiasma.Data.TmuxRequest.TmuxRequest
+ Chiasma.Data.TmuxRequest: queryArgs :: TmuxQuery -> [Text]
+ Chiasma.Data.TmuxResponse: TmuxResponse :: [Text] -> TmuxResponse
+ Chiasma.Data.TmuxResponse: [$sel:unTmuxResponse:TmuxResponse] :: TmuxResponse -> [Text]
+ Chiasma.Data.TmuxResponse: instance GHC.Base.Monoid Chiasma.Data.TmuxResponse.TmuxResponse
+ Chiasma.Data.TmuxResponse: instance GHC.Base.Semigroup Chiasma.Data.TmuxResponse.TmuxResponse
+ Chiasma.Data.TmuxResponse: instance GHC.Classes.Eq Chiasma.Data.TmuxResponse.TmuxResponse
+ Chiasma.Data.TmuxResponse: instance GHC.Show.Show Chiasma.Data.TmuxResponse.TmuxResponse
+ Chiasma.Data.TmuxResponse: newtype TmuxResponse
+ Chiasma.Data.WindowParams: WindowParams :: Bool -> Bool -> Bool -> Bool -> Maybe (Path Abs Dir) -> Map Text Text -> Maybe Ident -> Target -> Maybe Text -> WindowParams
+ Chiasma.Data.WindowParams: [$sel:after:WindowParams] :: WindowParams -> Bool
+ Chiasma.Data.WindowParams: [$sel:command:WindowParams] :: WindowParams -> Maybe Text
+ Chiasma.Data.WindowParams: [$sel:cwd:WindowParams] :: WindowParams -> Maybe (Path Abs Dir)
+ Chiasma.Data.WindowParams: [$sel:detach:WindowParams] :: WindowParams -> Bool
+ Chiasma.Data.WindowParams: [$sel:environment:WindowParams] :: WindowParams -> Map Text Text
+ Chiasma.Data.WindowParams: [$sel:killExisting:WindowParams] :: WindowParams -> Bool
+ Chiasma.Data.WindowParams: [$sel:name:WindowParams] :: WindowParams -> Maybe Ident
+ Chiasma.Data.WindowParams: [$sel:printInfo:WindowParams] :: WindowParams -> Bool
+ Chiasma.Data.WindowParams: [$sel:target:WindowParams] :: WindowParams -> Target
+ Chiasma.Data.WindowParams: data WindowParams
+ Chiasma.Data.WindowParams: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.WindowParams.WindowParams
+ Chiasma.Data.WindowParams: instance Data.Default.Class.Default Chiasma.Data.WindowParams.WindowParams
+ Chiasma.Data.WindowParams: instance GHC.Classes.Eq Chiasma.Data.WindowParams.WindowParams
+ Chiasma.Data.WindowParams: instance GHC.Show.Show Chiasma.Data.WindowParams.WindowParams
+ Chiasma.Data.WindowSelection: All :: WindowSelection
+ Chiasma.Data.WindowSelection: InSession :: Target -> WindowSelection
+ Chiasma.Data.WindowSelection: data WindowSelection
+ Chiasma.Data.WindowSelection: instance Chiasma.Class.CmdArgs.CmdArgs Chiasma.Data.WindowSelection.WindowSelection
+ Chiasma.Data.WindowSelection: instance Data.Default.Class.Default Chiasma.Data.WindowSelection.WindowSelection
+ Chiasma.Data.WindowSelection: instance GHC.Classes.Eq Chiasma.Data.WindowSelection.WindowSelection
+ Chiasma.Data.WindowSelection: instance GHC.Show.Show Chiasma.Data.WindowSelection.WindowSelection
+ Chiasma.Data.WithPaneId: WithPaneId :: PaneId -> a -> WithPaneId a
+ Chiasma.Data.WithPaneId: [$sel:pane:WithPaneId] :: WithPaneId a -> a
+ Chiasma.Data.WithPaneId: [$sel:paneId:WithPaneId] :: WithPaneId a -> PaneId
+ Chiasma.Data.WithPaneId: data WithPaneId a
+ Chiasma.Data.WithPaneId: instance Chiasma.Codec.TmuxCodec a => Chiasma.Codec.TmuxCodec (Chiasma.Data.WithPaneId.WithPaneId a)
+ Chiasma.Data.WithPaneId: instance Chiasma.Data.TmuxId.HasPaneId (Chiasma.Data.WithPaneId.WithPaneId a)
+ Chiasma.Data.WithPaneId: instance GHC.Classes.Eq a => GHC.Classes.Eq (Chiasma.Data.WithPaneId.WithPaneId a)
+ Chiasma.Data.WithPaneId: instance GHC.Generics.Generic (Chiasma.Data.WithPaneId.WithPaneId a)
+ Chiasma.Data.WithPaneId: instance GHC.Show.Show a => GHC.Show.Show (Chiasma.Data.WithPaneId.WithPaneId a)
+ Chiasma.Data.WithPaneId: safeBreakOn :: Text -> Text -> Maybe (Text, Text)
+ Chiasma.Effect.Codec: [Encode] :: command a -> Codec command i o m i
+ Chiasma.Effect.Codec: [WithCodec] :: command a -> (i -> m o) -> Codec command i o m a
+ Chiasma.Effect.Codec: data Codec (command :: Type -> Type) (i :: Type) (o :: Type) :: Effect
+ Chiasma.Effect.Codec: encode :: forall command_a1mtf i_a1mth o_a1mti r_a1mvc a_X0. Member (Codec command_a1mtf i_a1mth o_a1mti) r_a1mvc => command_a1mtf a_X0 -> Sem r_a1mvc i_a1mth
+ Chiasma.Effect.Codec: type NativeCodec command = Codec command TmuxRequest TmuxResponse
+ Chiasma.Effect.Codec: type NativeCodecE command = NativeCodec command !! CodecError
+ Chiasma.Effect.Codec: type NativeCommandCodec = NativeCodec TmuxCommand
+ Chiasma.Effect.Codec: type NativeCommandCodecE = NativeCodecE TmuxCommand
+ Chiasma.Effect.Codec: type family NativeCodecsE (cs :: [Type -> Type]) :: [Effect]
+ Chiasma.Effect.Codec: withCodec :: forall command_a1mta i_a1mtc o_a1mte r_a1mv9 a_a1mtb. Member (Codec command_a1mta i_a1mtc o_a1mte) r_a1mv9 => command_a1mta a_a1mtb -> (i_a1mtc -> Sem r_a1mv9 o_a1mte) -> Sem r_a1mv9 a_a1mtb
+ Chiasma.Effect.TmuxApi: [Schedule] :: command a -> TmuxApi command m ()
+ Chiasma.Effect.TmuxApi: [Send] :: command a -> TmuxApi command m a
+ Chiasma.Effect.TmuxApi: data TmuxApi (command :: Type -> Type) :: Effect
+ Chiasma.Effect.TmuxApi: schedule :: forall command_a1lEU r_a1lGe a_X0. Member (TmuxApi command_a1lEU) r_a1lGe => command_a1lEU a_X0 -> Sem r_a1lGe ()
+ Chiasma.Effect.TmuxApi: send :: forall command_a1lER r_a1lGc a_a1lES. Member (TmuxApi command_a1lER) r_a1lGc => command_a1lER a_a1lES -> Sem r_a1lGc a_a1lES
+ Chiasma.Effect.TmuxApi: type Tmux = TmuxApi TmuxCommand
+ Chiasma.Effect.TmuxClient: [Schedule] :: i -> TmuxClient i o m ()
+ Chiasma.Effect.TmuxClient: [Send] :: i -> TmuxClient i o m o
+ Chiasma.Effect.TmuxClient: data TmuxClient (i :: Type) (o :: Type) :: Effect
+ Chiasma.Effect.TmuxClient: flush :: Member (TmuxClient e d) r => InterpreterFor (TmuxClient e d) r
+ Chiasma.Effect.TmuxClient: schedule :: forall i_a16vv o_a16vw r_a16x2. Member (TmuxClient i_a16vv o_a16vw) r_a16x2 => i_a16vv -> Sem r_a16x2 ()
+ Chiasma.Effect.TmuxClient: send :: forall i_a16vs o_a16vt r_a16x0. Member (TmuxClient i_a16vs o_a16vt) r_a16x0 => i_a16vs -> Sem r_a16x0 o_a16vt
+ Chiasma.Effect.TmuxClient: type NativeTmux = ScopedTmux TmuxRequest TmuxResponse
+ Chiasma.Effect.TmuxClient: type ScopedTmux i o = Scoped_ (TmuxClient i o)
+ Chiasma.Event: listen :: forall enc dec err t d r. Show err => Member (Codec ReceiveEvent enc dec !! err) r => Members [Scoped_ (TmuxClient enc dec) !! TmuxError, Events Event, Time t d, Log] r => Sem r ()
+ Chiasma.Event: listenLoop :: forall err t d r. Show err => Members [TmuxApi ReceiveEvent !! err, Events Event, Time t d, Log] r => Sem r ()
+ Chiasma.Event: receiveEvent :: forall r. Members [TmuxApi ReceiveEvent, Events Event] r => Sem r ()
+ Chiasma.Event: withTmuxEvents :: Show err => Member (Codec ReceiveEvent enc dec !! err) r => Member (Scoped_ (TmuxClient enc dec) !! TmuxError) r => Members [Events Event, Time t d, Log, Race, Async, Resource] r => Sem r a -> Sem r a
+ Chiasma.Function: applyWhen :: Bool -> (a -> a) -> a -> a
+ Chiasma.Interpreter.Codec: interpretCodecNative :: (forall x. cmd x -> TmuxRequest) -> (forall x. TmuxResponse -> cmd x -> Either DecodeError x) -> InterpreterFor (Codec cmd TmuxRequest TmuxResponse !! CodecError) r
+ Chiasma.Interpreter.Codec: interpretCodecPanes :: TmuxCodec p => InterpreterFor (Codec (Panes p) TmuxRequest TmuxResponse !! CodecError) r
+ Chiasma.Interpreter.Codec: interpretCodecPure :: (forall a. command a -> Sem r (Either Text a)) -> InterpreterFor (Codec command () decode !! Text) r
+ Chiasma.Interpreter.Codec: interpretCodecTmuxCommand :: InterpreterFor (Codec TmuxCommand TmuxRequest TmuxResponse !! CodecError) r
+ Chiasma.Interpreter.ProcessOutput: interpretProcessOutputTmuxBlock :: forall p r. Member (Embed IO) r => InterpreterFor (ProcessOutput p (Either Text TmuxOutputBlock)) r
+ Chiasma.Interpreter.ProcessOutput: parseResult :: Member (AtomicState (Maybe ParseCont)) r => ParseResult -> Sem r ([Either Text TmuxOutputBlock], ByteString)
+ Chiasma.Interpreter.ProcessOutput: type ParseCont = ByteString -> IResult ByteString TmuxOutputBlock
+ Chiasma.Interpreter.ProcessOutput: type ParseResult = IResult ByteString TmuxOutputBlock
+ Chiasma.Interpreter.Pure: interpretTmuxPure :: (forall a. command a -> Sem r (Either Text a)) -> InterpretersFor [Scoped_ (TmuxClient () ()) !! TmuxError, Codec command () () !! Text] r
+ Chiasma.Interpreter.TmuxApi: class InterpretApis (commands :: [Type -> Type]) err i o r
+ Chiasma.Interpreter.TmuxApi: class RestopApis (commands :: [Type -> Type]) err i o r
+ Chiasma.Interpreter.TmuxApi: data TmuxApiEffect :: Type -> (Type -> Type) -> Exp Effect
+ Chiasma.Interpreter.TmuxApi: flush :: Member (TmuxApi c) r => InterpreterFor (TmuxApi c) r
+ Chiasma.Interpreter.TmuxApi: instance (r1 GHC.Types.~ ((Chiasma.Effect.TmuxApi.TmuxApi Chiasma.Interpreter.TmuxApi.<$> commands) IncipitCore.++ (Chiasma.Effect.TmuxClient.TmuxClient i o : r)), Polysemy.Internal.Members '[Chiasma.Effect.TmuxClient.TmuxClient i o, Polysemy.Resume.Effect.Stop.Stop err] r1, Polysemy.Internal.Union.Member (Chiasma.Effect.Codec.Codec command i o Polysemy.Resume.Effect.Resumable.!! err) r1, Chiasma.Interpreter.TmuxApi.RestopApis commands err i o r) => Chiasma.Interpreter.TmuxApi.RestopApis (command : commands) err i o r
+ Chiasma.Interpreter.TmuxApi: instance (r1 GHC.Types.~ (Chiasma.Interpreter.TmuxApi.TmuxApis commands err IncipitCore.++ (Chiasma.Effect.TmuxClient.TmuxClient i o : r)), Polysemy.Internal.Union.Member (Chiasma.Effect.TmuxClient.TmuxClient i o) r1, Polysemy.Internal.Union.Member (Chiasma.Effect.Codec.Codec command i o Polysemy.Resume.Effect.Resumable.!! err) r1, Chiasma.Interpreter.TmuxApi.InterpretApis commands err i o r) => Chiasma.Interpreter.TmuxApi.InterpretApis (command : commands) err i o r
+ Chiasma.Interpreter.TmuxApi: instance Chiasma.Interpreter.TmuxApi.InterpretApis '[] err i o r
+ Chiasma.Interpreter.TmuxApi: instance forall k (err :: k) i o (r :: [(* -> *) -> * -> *]). Chiasma.Interpreter.TmuxApi.RestopApis '[] err i o r
+ Chiasma.Interpreter.TmuxApi: interpretApis :: InterpretApis commands err i o r => InterpretersFor (TmuxApis commands err) (TmuxClient i o : r)
+ Chiasma.Interpreter.TmuxApi: interpretTmuxApi :: forall command i o err r. Members [TmuxClient i o, Codec command i o !! err] r => InterpreterFor (TmuxApi command !! err) r
+ Chiasma.Interpreter.TmuxApi: restopApis :: RestopApis commands err i o r => InterpretersFor (TmuxApi <$> commands) (TmuxClient i o : r)
+ Chiasma.Interpreter.TmuxApi: type InterpretApisNative commands r = InterpretApis commands CodecError TmuxRequest TmuxResponse r
+ Chiasma.Interpreter.TmuxApi: type RestopApisNative commands r = RestopApis commands CodecError TmuxRequest TmuxResponse r
+ Chiasma.Interpreter.TmuxApi: type family TmuxApis (commands :: [Type -> Type]) (err :: Type) :: EffectRow
+ Chiasma.Interpreter.TmuxClient: flush :: Members [TmuxProc, AtomicState (Seq TmuxRequest), Log, Stop TmuxError] r => Sem r ()
+ Chiasma.Interpreter.TmuxClient: interpretProcessTmux :: Member (Scoped_ (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r => Members [Resource, Race, Async, Embed IO] r => InterpreterFor (Scoped_ TmuxProc !! ProcessError) r
+ Chiasma.Interpreter.TmuxClient: interpretSystemProcessTmux :: Members [Reader TmuxNative, Resource, Race, Async, Embed IO] r => InterpreterFor (Scoped_ (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r
+ Chiasma.Interpreter.TmuxClient: interpretTmuxClientNull :: InterpreterFor (Scoped_ (TmuxClient i ()) !! TmuxError) r
+ Chiasma.Interpreter.TmuxClient: interpretTmuxFailing :: TmuxError -> InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r
+ Chiasma.Interpreter.TmuxClient: interpretTmuxNative :: forall r. Members [Reader TmuxNative, Log, Resource, Race, Async, Embed IO] r => InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r
+ Chiasma.Interpreter.TmuxClient: interpretTmuxNativeEnv :: Members [Error TmuxError, Log, Resource, Race, Async, Embed IO] r => Maybe (Path Abs File) -> InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r
+ Chiasma.Interpreter.TmuxClient: interpretTmuxNativeEnvGraceful :: Members [Log, Resource, Race, Async, Embed IO] r => Maybe (Path Abs File) -> InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r
+ Chiasma.Interpreter.TmuxClient: interpretTmuxProcessBuffered :: Members [AtomicState (Seq TmuxRequest), Scoped_ TmuxProc !! ProcessError, Log, Embed IO] r => InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r
+ Chiasma.Interpreter.TmuxClient: interpretTmuxWithProcess :: Members [Scoped_ TmuxProc !! ProcessError, Log, Embed IO] r => InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r
+ Chiasma.Interpreter.TmuxClient: runReaderTmuxNativeEnv :: Members [Error TmuxError, Embed IO] r => Maybe (Path Abs File) -> InterpreterFor (Reader TmuxNative) r
+ Chiasma.Interpreter.TmuxClient: socketArg :: Path Abs File -> [String]
+ Chiasma.Interpreter.TmuxClient: tmuxProc :: TmuxNative -> ProcessConfig () () ()
+ Chiasma.Interpreter.TmuxClient: tmuxRequest :: Members [Process ByteString (Either Text TmuxOutputBlock), Log, Stop TmuxError] r => TmuxRequest -> Sem r TmuxResponse
+ Chiasma.Interpreter.TmuxClient: tmuxSession :: forall r a. Members [Scoped_ TmuxProc !! ProcessError, AtomicState (Seq TmuxRequest), Log, Stop TmuxError] r => Sem (TmuxProc : r) a -> Sem r a
+ Chiasma.Interpreter.TmuxClient: type TmuxProc = Process ByteString (Either Text TmuxOutputBlock)
+ Chiasma.Interpreter.TmuxClient: type TmuxQueues = ProcessQueues (Either Text TmuxOutputBlock) Text
+ Chiasma.Interpreter.TmuxClient: validate :: TmuxRequest -> TmuxOutputBlock -> Either TmuxError TmuxResponse
+ Chiasma.Interpreter.TmuxClient: withTmuxNativeEnv :: Member (Embed IO) r => Maybe (Path Abs File) -> (Maybe TmuxNative -> Sem r a) -> Sem r a
+ Chiasma.Native.TmuxOutputBlock: beginLine :: (Alternative m, CharParsing m, Monad m) => m ()
+ Chiasma.Native.TmuxOutputBlock: endLine :: (Alternative m, CharParsing m) => m End
+ Chiasma.Native.TmuxOutputBlock: notBeginLine :: (Alternative m, CharParsing m, Monad m) => m ()
+ Chiasma.Native.TmuxOutputBlock: parseBlock :: (Alternative m, CharParsing m, Monad m, LookAheadParsing m) => m TmuxOutputBlock
+ Chiasma.Native.TmuxOutputBlock: parseBlocks :: (Alternative m, CharParsing m, Monad m, LookAheadParsing m) => m [TmuxOutputBlock]
+ Chiasma.Native.TmuxOutputBlock: parser :: Parser TmuxOutputBlock
+ Chiasma.Native.TmuxOutputBlock: tillEol :: (Alternative m, CharParsing m) => m Text
+ Chiasma.Pack: describeAxis :: Axis -> Doc a
+ Chiasma.Path: pathText :: Path b t -> Text
+ Chiasma.Path: pathText' :: Path b t -> Text
+ Chiasma.Tmux: insertAfter :: forall left e r a. KnownList left => Sem (left ++ r) a -> Sem (left ++ (e : r)) a
+ Chiasma.Tmux: withPanes :: forall p err i o r. Members [ScopedTmux i o, Codec (Panes p) i o !! err] r => InterpreterFor (TmuxPanes p !! err) r
+ Chiasma.Tmux: withPanes_ :: forall p err i o r. Members [ScopedTmux i o, Codec (Panes p) i o !! err, Stop err] r => InterpreterFor (TmuxPanes p) r
+ Chiasma.Tmux: withTmux :: forall command err i o r. Members [ScopedTmux i o, Codec command i o !! err] r => InterpreterFor (TmuxApi command !! err) r
+ Chiasma.Tmux: withTmuxApis :: forall commands err i o r. KnownList (TmuxApis commands err) => InterpretApis commands err i o r => Member (ScopedTmux i o) r => InterpretersFor (TmuxApis commands err) r
+ Chiasma.Tmux: withTmuxApis' :: forall commands err i o r a. InterpretApis commands err i o r => Member (ScopedTmux i o) r => Sem (TmuxApis commands err ++ (TmuxClient i o : r)) a -> Sem r a
+ Chiasma.Tmux: withTmuxApis_ :: forall commands err i o apis r. apis ~ (TmuxApi <$> commands) => KnownList apis => RestopApis commands err i o r => Member (ScopedTmux i o) r => InterpretersFor apis r
+ Chiasma.Tmux: withTmux_ :: forall command err i o r. Members [ScopedTmux i o, Codec command i o !! err, Stop err] r => InterpreterFor (TmuxApi command) r
+ Chiasma.TmuxNative: withPanesNative :: forall p r. Members [NativeTmux, NativeCodecE (Panes p)] r => InterpreterFor (TmuxPanes p !! CodecError) r
+ Chiasma.TmuxNative: withPanesNative_ :: forall p r. Members [NativeTmux, NativeCodecE (Panes p), Stop CodecError] r => InterpreterFor (TmuxPanes p) r
+ Chiasma.TmuxNative: withTmuxApisNative :: forall commands r. KnownList (TmuxApis commands CodecError) => InterpretApisNative commands r => Member NativeTmux r => InterpretersFor (TmuxApis commands CodecError) r
+ Chiasma.TmuxNative: withTmuxApisNative' :: forall commands r a. InterpretApisNative commands r => Member NativeTmux r => Sem (TmuxApis commands CodecError ++ (TmuxClient TmuxRequest TmuxResponse : r)) a -> Sem r a
+ Chiasma.TmuxNative: withTmuxApisNative_ :: forall commands r. KnownList (TmuxApi <$> commands) => RestopApisNative commands r => Member NativeTmux r => InterpretersFor (TmuxApi <$> commands) r
+ Chiasma.TmuxNative: withTmuxNative :: forall command r. Members [NativeTmux, NativeCodecE command] r => InterpreterFor (TmuxApi command !! CodecError) r
+ Chiasma.TmuxNative: withTmuxNative_ :: forall command r. Members [NativeTmux, NativeCodecE command, Stop CodecError] r => InterpreterFor (TmuxApi command) r
+ Chiasma.Ui.Data.Measure: [$sel:_axis:MLayout] :: MLayout -> Axis
+ Chiasma.Ui.Data.Measure: axis :: HasMLayout c_a1tE0 => Lens' c_a1tE0 Axis
+ Chiasma.Ui.Data.RenderableTree: [$sel:_axis:RLayout] :: RLayout -> Axis
+ Chiasma.Ui.Data.Tree: instance (GHC.Classes.Eq l, GHC.Classes.Eq (Chiasma.Ui.Data.Tree.Node GHC.Base.NonEmpty l p)) => GHC.Classes.Eq (Chiasma.Ui.Data.Tree.Tree GHC.Base.NonEmpty l p)
+ Chiasma.Ui.Data.Tree: instance (GHC.Classes.Eq l, GHC.Classes.Eq (Chiasma.Ui.Data.Tree.Node [] l p)) => GHC.Classes.Eq (Chiasma.Ui.Data.Tree.Tree [] l p)
+ Chiasma.Ui.Data.Tree: instance (GHC.Show.Show l, GHC.Show.Show (Chiasma.Ui.Data.Tree.Node GHC.Base.NonEmpty l p)) => GHC.Show.Show (Chiasma.Ui.Data.Tree.Tree GHC.Base.NonEmpty l p)
+ Chiasma.Ui.Data.Tree: instance (GHC.Show.Show l, GHC.Show.Show (Chiasma.Ui.Data.Tree.Node [] l p)) => GHC.Show.Show (Chiasma.Ui.Data.Tree.Tree [] l p)
+ Chiasma.Ui.Data.View: [$sel:axis:Layout] :: Layout -> Axis
+ Chiasma.Ui.Data.View: _axis :: HasLayout c_a1Bgj => Lens' c_a1Bgj Axis
+ Chiasma.Ui.Lens.Ident: identEither :: Identifiable a => Ident -> a -> Either a a
+ Chiasma.Ui.Measure.Weights: amendWeights :: NonEmpty (Maybe Float) -> NonEmpty Float
+ Chiasma.Ui.Measure.Weights: effectiveWeight :: ViewState -> ViewGeometry -> Maybe Float
+ Chiasma.Ui.ViewTree: toggleResultEither :: ToggleResult a -> Either Text a
- Chiasma.Codec: decode :: (TmuxCodec a, Generic a, TmuxDataDecode (Rep a)) => Text -> Either TmuxDecodeError a
+ Chiasma.Codec: decode :: (TmuxCodec a, Generic a) => TmuxDataDecode (Rep a) => Text -> Either DecodeError a
- Chiasma.Codec: genDecode :: (Generic a, TmuxDataDecode (Rep a)) => Text -> Either TmuxDecodeError a
+ Chiasma.Codec: genDecode :: Generic a => TmuxDataDecode (Rep a) => Text -> Either DecodeError a
- Chiasma.Codec.Data: Pane :: PaneId -> Int -> Int -> Pane
+ Chiasma.Codec.Data: Pane :: PaneId -> Int -> Int -> Int -> Int -> Pane
- Chiasma.Codec.Data: Session :: SessionId -> Session
+ Chiasma.Codec.Data: Session :: SessionId -> Text -> Session
- Chiasma.Codec.Data.Pane: Pane :: PaneId -> Int -> Int -> Pane
+ Chiasma.Codec.Data.Pane: Pane :: PaneId -> Int -> Int -> Int -> Int -> Pane
- Chiasma.Codec.Data.Session: Session :: SessionId -> Session
+ Chiasma.Codec.Data.Session: Session :: SessionId -> Text -> Session
- Chiasma.Codec.Decode: idParser :: Char -> GenParser Char st Text
+ Chiasma.Codec.Decode: idParser :: Text -> GenParser Char st Text
- Chiasma.Codec.Decode: parseId :: (Int -> a) -> Char -> Text -> Either TmuxDecodeError a
+ Chiasma.Codec.Decode: parseId :: (Int -> a) -> Text -> Text -> Either DecodeFailure a
- Chiasma.Codec.Decode: primDecode :: TmuxPrimDecode a => Text -> Either TmuxDecodeError a
+ Chiasma.Codec.Decode: primDecode :: TmuxPrimDecode a => Text -> Either DecodeFailure a
- Chiasma.Codec.Decode: readInt :: Text -> Text -> Either TmuxDecodeError Int
+ Chiasma.Codec.Decode: readInt :: Text -> Text -> Either DecodeFailure Int
- Chiasma.Command.Pane: capturePane :: MonadFree TmuxThunk m => PaneId -> m [Text]
+ Chiasma.Command.Pane: capturePane :: Member Tmux r => PaneId -> Sem r [Text]
- Chiasma.Command.Pane: closePane :: MonadFree TmuxThunk m => PaneId -> m ()
+ Chiasma.Command.Pane: closePane :: Member Tmux r => PaneId -> Sem r ()
- Chiasma.Command.Pane: copyMode :: MonadFree TmuxThunk m => PaneId -> m ()
+ Chiasma.Command.Pane: copyMode :: Member Tmux r => PaneId -> Sem r ()
- Chiasma.Command.Pane: firstWindowPane :: MonadFree TmuxThunk m => WindowId -> m Pane
+ Chiasma.Command.Pane: firstWindowPane :: Member (TmuxPanes a) r => WindowId -> Sem r a
- Chiasma.Command.Pane: isPaneIdOpen :: MonadFree TmuxThunk m => PaneId -> m Bool
+ Chiasma.Command.Pane: isPaneIdOpen :: Member (TmuxPanes Pane) r => PaneId -> Sem r Bool
- Chiasma.Command.Pane: isPaneOpen :: MonadFree TmuxThunk m => View PaneId -> m Bool
+ Chiasma.Command.Pane: isPaneOpen :: Member (TmuxPanes Pane) r => View PaneId -> Sem r Bool
- Chiasma.Command.Pane: movePane :: MonadFree TmuxThunk m => PaneId -> PaneId -> Bool -> m ()
+ Chiasma.Command.Pane: movePane :: Member Tmux r => PaneId -> PaneId -> Axis -> Sem r ()
- Chiasma.Command.Pane: pane :: (MonadFree TmuxThunk m, TmuxCodec a, HasPaneId a) => PaneId -> m (Maybe a)
+ Chiasma.Command.Pane: pane :: Member (TmuxPanes a) r => PaneId -> Sem r (Maybe a)
- Chiasma.Command.Pane: paneMode :: MonadFree TmuxThunk m => PaneId -> m (Maybe PaneMode)
+ Chiasma.Command.Pane: paneMode :: Member (TmuxPanes PaneMode) r => PaneId -> Sem r (Maybe PaneMode)
- Chiasma.Command.Pane: panes :: MonadFree TmuxThunk m => m [Pane]
+ Chiasma.Command.Pane: panes :: Member (TmuxPanes a) r => Sem r [a]
- Chiasma.Command.Pane: pipePane :: MonadFree TmuxThunk m => PaneId -> Text -> m ()
+ Chiasma.Command.Pane: pipePane :: Member Tmux r => PaneId -> Text -> Sem r ()
- Chiasma.Command.Pane: quitCopyMode :: MonadFree TmuxThunk m => PaneId -> m ()
+ Chiasma.Command.Pane: quitCopyMode :: Member Tmux r => Member (TmuxPanes PaneMode) r => PaneId -> Sem r ()
- Chiasma.Command.Pane: resizePane :: MonadFree TmuxThunk m => PaneId -> Bool -> Int -> m ()
+ Chiasma.Command.Pane: resizePane :: Member Tmux r => PaneId -> Axis -> Int -> Sem r ()
- Chiasma.Command.Pane: selectPane :: MonadFree TmuxThunk m => PaneId -> m ()
+ Chiasma.Command.Pane: selectPane :: Member Tmux r => PaneId -> Sem r ()
- Chiasma.Command.Pane: sendKeys :: MonadFree TmuxThunk m => PaneId -> [Text] -> m ()
+ Chiasma.Command.Pane: sendKeys :: Member Tmux r => PaneId -> [Key] -> Sem r ()
- Chiasma.Command.Pane: windowPanes :: MonadFree TmuxThunk m => WindowId -> m [Pane]
+ Chiasma.Command.Pane: windowPanes :: Member (TmuxPanes a) r => WindowId -> Sem r [a]
- Chiasma.Command.Session: doesSessionExist :: MonadFree TmuxThunk m => SessionId -> m Bool
+ Chiasma.Command.Session: doesSessionExist :: Member Tmux r => SessionId -> Sem r Bool
- Chiasma.Command.Session: existingSessionId :: MonadFree TmuxThunk m => SessionId -> m (Maybe SessionId)
+ Chiasma.Command.Session: existingSessionId :: Member Tmux r => SessionId -> Sem r (Maybe SessionId)
- Chiasma.Command.Session: newSession :: MonadFree TmuxThunk m => Ident -> m Session
+ Chiasma.Command.Session: newSession :: Member Tmux r => Ident -> Sem r Session
- Chiasma.Command.Session: sessions :: MonadFree TmuxThunk m => m [Session]
+ Chiasma.Command.Session: sessions :: Member Tmux r => Sem r [Session]
- Chiasma.Command.Window: doesWindowExist :: MonadFree TmuxThunk m => WindowId -> m Bool
+ Chiasma.Command.Window: doesWindowExist :: Member Tmux r => WindowId -> Sem r Bool
- Chiasma.Command.Window: newSessionWindow :: MonadFree TmuxThunk m => SessionId -> m Window
+ Chiasma.Command.Window: newSessionWindow :: Members [Tmux, Stop LayoutError] r => SessionId -> Sem r Window
- Chiasma.Command.Window: newWindow :: MonadFree TmuxThunk m => SessionId -> Ident -> m Window
+ Chiasma.Command.Window: newWindow :: Member Tmux r => SessionId -> Ident -> Sem r Window
- Chiasma.Command.Window: sessionWindows :: MonadFree TmuxThunk m => SessionId -> m [Window]
+ Chiasma.Command.Window: sessionWindows :: Member Tmux r => SessionId -> Sem r [Window]
- Chiasma.Command.Window: splitWindow :: MonadFree TmuxThunk m => FilePath -> WindowId -> m Pane
+ Chiasma.Command.Window: splitWindow :: Member Tmux r => WindowId -> Sem r Pane
- Chiasma.Command.Window: window :: MonadFree TmuxThunk m => WindowId -> m (Maybe Window)
+ Chiasma.Command.Window: window :: Member Tmux r => WindowId -> Sem r (Maybe Window)
- Chiasma.Command.Window: windows :: MonadFree TmuxThunk m => m [Window]
+ Chiasma.Command.Window: windows :: Member Tmux r => Sem r [Window]
- Chiasma.Data.TmuxError: ProcessFailed :: Cmds -> Text -> TmuxError
+ Chiasma.Data.TmuxError: ProcessFailed :: ProcessError -> TmuxError
- Chiasma.Data.TmuxId: TmuxIdPrefix :: Char -> TmuxIdPrefix a
+ Chiasma.Data.TmuxId: TmuxIdPrefix :: Text -> TmuxIdPrefix a
- Chiasma.Data.TmuxId: panePrefix :: Char
+ Chiasma.Data.TmuxId: panePrefix :: Text
- Chiasma.Data.TmuxId: sessionPrefix :: Char
+ Chiasma.Data.TmuxId: sessionPrefix :: Text
- Chiasma.Data.TmuxId: windowPrefix :: Char
+ Chiasma.Data.TmuxId: windowPrefix :: Text
- Chiasma.Data.View: _viewId :: HasView c_aRzy a_aRx7 => Lens' c_aRzy (Maybe a_aRx7)
+ Chiasma.Data.View: _viewId :: HasView c_a12B6 a_a11Fa => Lens' c_a12B6 (Maybe a_a11Fa)
- Chiasma.Data.View: _viewIdent :: HasView c_aRzy a_aRx7 => Lens' c_aRzy Ident
+ Chiasma.Data.View: _viewIdent :: HasView c_a12B6 a_a11Fa => Lens' c_a12B6 Ident
- Chiasma.Data.View: class HasView c_aRzy a_aRx7 | c_aRzy -> a_aRx7
+ Chiasma.Data.View: class HasView c_a12B6 a_a11Fa | c_a12B6 -> a_a11Fa
- Chiasma.Data.View: view :: HasView c_aRzy a_aRx7 => Lens' c_aRzy (View a_aRx7)
+ Chiasma.Data.View: view :: HasView c_a12B6 a_a11Fa => Lens' c_a12B6 (View a_a11Fa)
- Chiasma.Data.Views: class HasViews c_aStQ
+ Chiasma.Data.Views: class HasViews c_a13sV
- Chiasma.Data.Views: log :: HasViews c_aStQ => Lens' c_aStQ [Doc AnsiStyle]
+ Chiasma.Data.Views: log :: HasViews c_a13sV => Lens' c_a13sV [Doc AnsiStyle]
- Chiasma.Data.Views: panes :: HasViews c_aStQ => Lens' c_aStQ [View PaneId]
+ Chiasma.Data.Views: panes :: HasViews c_a13sV => Lens' c_a13sV [View PaneId]
- Chiasma.Data.Views: sessions :: HasViews c_aStQ => Lens' c_aStQ [View SessionId]
+ Chiasma.Data.Views: sessions :: HasViews c_a13sV => Lens' c_a13sV [View SessionId]
- Chiasma.Data.Views: views :: HasViews c_aStQ => Lens' c_aStQ Views
+ Chiasma.Data.Views: views :: HasViews c_a13sV => Lens' c_a13sV Views
- Chiasma.Data.Views: windows :: HasViews c_aStQ => Lens' c_aStQ [View WindowId]
+ Chiasma.Data.Views: windows :: HasViews c_a13sV => Lens' c_a13sV [View WindowId]
- Chiasma.Lens.Tree: _litTree :: HasLeafIndexTree c_aMwG l_aMrh p_aMri => Lens' c_aMwG (Tree l_aMrh p_aMri)
+ Chiasma.Lens.Tree: _litTree :: HasLeafIndexTree c_a1JSH l_a1JNW p_a1JNX => Lens' c_a1JSH (Tree l_a1JNW p_a1JNX)
- Chiasma.Lens.Tree: _nitTree :: HasNodeIndexTree c_aMr9 l_aMnF p_aMnG => Lens' c_aMr9 (Tree l_aMnF p_aMnG)
+ Chiasma.Lens.Tree: _nitTree :: HasNodeIndexTree c_a1JNO l_a1JL1 p_a1JL2 => Lens' c_a1JNO (Tree l_a1JL1 p_a1JL2)
- Chiasma.Lens.Tree: class HasLeafIndexTree c_aMwG l_aMrh p_aMri | c_aMwG -> l_aMrh p_aMri
+ Chiasma.Lens.Tree: class HasLeafIndexTree c_a1JSH l_a1JNW p_a1JNX | c_a1JSH -> l_a1JNW p_a1JNX
- Chiasma.Lens.Tree: class HasNodeIndexTree c_aMr9 l_aMnF p_aMnG | c_aMr9 -> l_aMnF p_aMnG
+ Chiasma.Lens.Tree: class HasNodeIndexTree c_a1JNO l_a1JL1 p_a1JL2 | c_a1JNO -> l_a1JL1 p_a1JL2
- Chiasma.Lens.Tree: leafIndexTree :: HasLeafIndexTree c_aMwG l_aMrh p_aMri => Lens' c_aMwG (LeafIndexTree l_aMrh p_aMri)
+ Chiasma.Lens.Tree: leafIndexTree :: HasLeafIndexTree c_a1JSH l_a1JNW p_a1JNX => Lens' c_a1JSH (LeafIndexTree l_a1JNW p_a1JNX)
- Chiasma.Lens.Tree: nodeIndexTree :: HasNodeIndexTree c_aMr9 l_aMnF p_aMnG => Lens' c_aMr9 (NodeIndexTree l_aMnF p_aMnG)
+ Chiasma.Lens.Tree: nodeIndexTree :: HasNodeIndexTree c_a1JNO l_a1JL1 p_a1JL2 => Lens' c_a1JNO (NodeIndexTree l_a1JL1 p_a1JL2)
- Chiasma.Pack: packPane :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => PaneId -> Bool -> PaneId -> m ()
+ Chiasma.Pack: packPane :: Members [AtomicState Views, Tmux] r => PaneId -> Axis -> PaneId -> Sem r ()
- Chiasma.Pack: packTree :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => MeasureTree -> m ()
+ Chiasma.Pack: packTree :: Members [AtomicState Views, Tmux] r => MeasureTree -> Sem r ()
- Chiasma.Pack: packWindow :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => WindowState -> m ()
+ Chiasma.Pack: packWindow :: Members [AtomicState Views, Tmux] r => WindowState -> Sem r ()
- Chiasma.Pack: positionView :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => Bool -> PaneId -> MeasureTreeSub -> m ()
+ Chiasma.Pack: positionView :: Members [AtomicState Views, Tmux] r => Axis -> PaneId -> MeasureTreeSub -> Sem r ()
- Chiasma.Pack: resizeView :: MonadDeepState s Views m => MonadFree TmuxThunk m => Bool -> MeasureTreeSub -> m ()
+ Chiasma.Pack: resizeView :: Members [AtomicState Views, Tmux] r => Axis -> MeasureTreeSub -> Sem r ()
- Chiasma.Pane: addPane :: MonadDeepState s Views m => Ident -> m (View PaneId)
+ Chiasma.Pane: addPane :: Member (AtomicState Views) r => Ident -> Sem r (View PaneId)
- Chiasma.Render: render :: (MonadDeepState s Views m, MonadFree TmuxThunk m, MonadError RenderError m) => FilePath -> Ident -> Ident -> ViewTree -> m ()
+ Chiasma.Render: render :: Members [TmuxPanes Pane !! CodecError, AtomicState Views, Tmux !! CodecError, Stop RenderError] r => Path Abs Dir -> Ident -> Ident -> ViewTree -> Sem r ()
- Chiasma.Render: renderTree :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => Ident -> Window -> RenderableTree -> m ()
+ Chiasma.Render: renderTree :: Members [TmuxPanes Pane, AtomicState Views, Tmux] r => Ident -> Window -> RenderableTree -> Sem r ()
- Chiasma.Session: ensureSession :: MonadDeepState s Views m => MonadFree TmuxThunk m => View SessionId -> View WindowId -> m (SessionId, Maybe WindowId)
+ Chiasma.Session: ensureSession :: Members [AtomicState Views, Tmux, Stop LayoutError] r => View SessionId -> View WindowId -> Sem r (SessionId, Maybe WindowId)
- Chiasma.Session: findOrCreateSession :: MonadDeepState s Views m => Ident -> m (View SessionId)
+ Chiasma.Session: findOrCreateSession :: Member (AtomicState Views) r => Ident -> Sem r (View SessionId)
- Chiasma.Session: spawnSession :: MonadDeepState s Views m => MonadFree TmuxThunk m => View SessionId -> View WindowId -> m (SessionId, WindowId)
+ Chiasma.Session: spawnSession :: Members [AtomicState Views, Tmux, Stop LayoutError] r => View SessionId -> View WindowId -> Sem r (SessionId, WindowId)
- Chiasma.Ui.Data.Measure: MLayout :: PaneId -> Int -> Int -> Bool -> MLayout
+ Chiasma.Ui.Data.Measure: MLayout :: PaneId -> Int -> Int -> Axis -> MLayout
- Chiasma.Ui.Data.Measure: class HasMLayout c_avMv
+ Chiasma.Ui.Data.Measure: class HasMLayout c_a1tE0
- Chiasma.Ui.Data.Measure: class HasMPane c_avGZ
+ Chiasma.Ui.Data.Measure: class HasMPane c_a1ty5
- Chiasma.Ui.Data.Measure: class HasMeasured c_avSQ a_avN4 | c_avSQ -> a_avN4
+ Chiasma.Ui.Data.Measure: class HasMeasured c_a1tPq a_a1tEz | c_a1tPq -> a_a1tEz
- Chiasma.Ui.Data.Measure: lMainPosition :: HasMLayout c_avMv => Lens' c_avMv Int
+ Chiasma.Ui.Data.Measure: lMainPosition :: HasMLayout c_a1tE0 => Lens' c_a1tE0 Int
- Chiasma.Ui.Data.Measure: lOffPosition :: HasMLayout c_avMv => Lens' c_avMv Int
+ Chiasma.Ui.Data.Measure: lOffPosition :: HasMLayout c_a1tE0 => Lens' c_a1tE0 Int
- Chiasma.Ui.Data.Measure: mLayout :: HasMLayout c_avMv => Lens' c_avMv MLayout
+ Chiasma.Ui.Data.Measure: mLayout :: HasMLayout c_a1tE0 => Lens' c_a1tE0 MLayout
- Chiasma.Ui.Data.Measure: mPane :: HasMPane c_avGZ => Lens' c_avGZ MPane
+ Chiasma.Ui.Data.Measure: mPane :: HasMPane c_a1ty5 => Lens' c_a1ty5 MPane
- Chiasma.Ui.Data.Measure: mainPosition :: HasMPane c_avGZ => Lens' c_avGZ Int
+ Chiasma.Ui.Data.Measure: mainPosition :: HasMPane c_a1ty5 => Lens' c_a1ty5 Int
- Chiasma.Ui.Data.Measure: measured :: HasMeasured c_avSQ a_avN4 => Lens' c_avSQ (Measured a_avN4)
+ Chiasma.Ui.Data.Measure: measured :: HasMeasured c_a1tPq a_a1tEz => Lens' c_a1tPq (Measured a_a1tEz)
- Chiasma.Ui.Data.Measure: offPosition :: HasMPane c_avGZ => Lens' c_avGZ Int
+ Chiasma.Ui.Data.Measure: offPosition :: HasMPane c_a1ty5 => Lens' c_a1ty5 Int
- Chiasma.Ui.Data.Measure: paneId :: HasMPane c_avGZ => Lens' c_avGZ PaneId
+ Chiasma.Ui.Data.Measure: paneId :: HasMPane c_a1ty5 => Lens' c_a1ty5 PaneId
- Chiasma.Ui.Data.Measure: reference :: HasMLayout c_avMv => Lens' c_avMv PaneId
+ Chiasma.Ui.Data.Measure: reference :: HasMLayout c_a1tE0 => Lens' c_a1tE0 PaneId
- Chiasma.Ui.Data.Measure: size :: HasMeasured c_avSQ a_avN4 => Lens' c_avSQ Int
+ Chiasma.Ui.Data.Measure: size :: HasMeasured c_a1tPq a_a1tEz => Lens' c_a1tPq Int
- Chiasma.Ui.Data.Measure: view :: HasMeasured c_avSQ a_avN4 => Lens' c_avSQ a_avN4
+ Chiasma.Ui.Data.Measure: view :: HasMeasured c_a1tPq a_a1tEz => Lens' c_a1tPq a_a1tEz
- Chiasma.Ui.Data.RenderableTree: RLayout :: RPane -> Bool -> RLayout
+ Chiasma.Ui.Data.RenderableTree: RLayout :: RPane -> Axis -> RLayout
- Chiasma.Ui.Data.Tree: class HasNode c_anrU f_anj0 l_anj1 p_anj2 | c_anrU -> f_anj0 l_anj1 p_anj2
+ Chiasma.Ui.Data.Tree: class HasNode c_a1rj6 f_a1ra2 l_a1ra3 p_a1ra4 | c_a1rj6 -> f_a1ra2 l_a1ra3 p_a1ra4
- Chiasma.Ui.Data.Tree: class HasTree c_anoa f_anj3 l_anj4 p_anj5 | c_anoa -> f_anj3 l_anj4 p_anj5
+ Chiasma.Ui.Data.Tree: class HasTree c_a1rfo f_a1ra5 l_a1ra6 p_a1ra7 | c_a1rfo -> f_a1ra5 l_a1ra6 p_a1ra7
- Chiasma.Ui.Data.Tree: forest :: HasTree c_anoa f_anj3 l_anj4 p_anj5 => Lens' c_anoa (f_anj3 (Node f_anj3 l_anj4 p_anj5))
+ Chiasma.Ui.Data.Tree: forest :: HasTree c_a1rfo f_a1ra5 l_a1ra6 p_a1ra7 => Lens' c_a1rfo (f_a1ra5 (Node f_a1ra5 l_a1ra6 p_a1ra7))
- Chiasma.Ui.Data.Tree: leafData :: HasNode c_anrU f_anj0 l_anj1 p_anj2 => Traversal' c_anrU p_anj2
+ Chiasma.Ui.Data.Tree: leafData :: HasNode c_a1rj6 f_a1ra2 l_a1ra3 p_a1ra4 => Traversal' c_a1rj6 p_a1ra4
- Chiasma.Ui.Data.Tree: node :: HasNode c_anrU f_anj0 l_anj1 p_anj2 => Lens' c_anrU (Node f_anj0 l_anj1 p_anj2)
+ Chiasma.Ui.Data.Tree: node :: HasNode c_a1rj6 f_a1ra2 l_a1ra3 p_a1ra4 => Lens' c_a1rj6 (Node f_a1ra2 l_a1ra3 p_a1ra4)
- Chiasma.Ui.Data.Tree: subTree :: HasNode c_anrU f_anj0 l_anj1 p_anj2 => Traversal' c_anrU (Tree f_anj0 l_anj1 p_anj2)
+ Chiasma.Ui.Data.Tree: subTree :: HasNode c_a1rj6 f_a1ra2 l_a1ra3 p_a1ra4 => Traversal' c_a1rj6 (Tree f_a1ra2 l_a1ra3 p_a1ra4)
- Chiasma.Ui.Data.Tree: tree :: HasTree c_anoa f_anj3 l_anj4 p_anj5 => Lens' c_anoa (Tree f_anj3 l_anj4 p_anj5)
+ Chiasma.Ui.Data.Tree: tree :: HasTree c_a1rfo f_a1ra5 l_a1ra6 p_a1ra7 => Lens' c_a1rfo (Tree f_a1ra5 l_a1ra6 p_a1ra7)
- Chiasma.Ui.Data.Tree: treeData :: HasTree c_anoa f_anj3 l_anj4 p_anj5 => Lens' c_anoa l_anj4
+ Chiasma.Ui.Data.Tree: treeData :: HasTree c_a1rfo f_a1ra5 l_a1ra6 p_a1ra7 => Lens' c_a1rfo l_a1ra6
- Chiasma.Ui.Data.View: Layout :: Bool -> Layout
+ Chiasma.Ui.Data.View: Layout :: Axis -> Layout
- Chiasma.Ui.Data.View: Pane :: Bool -> Bool -> Maybe FilePath -> Pane
+ Chiasma.Ui.Data.View: Pane :: Bool -> Bool -> Maybe Text -> Pane
- Chiasma.Ui.Data.View: [$sel:_cwd:Pane] :: Pane -> Maybe FilePath
+ Chiasma.Ui.Data.View: [$sel:_cwd:Pane] :: Pane -> Maybe Text
- Chiasma.Ui.Data.View: _treeData :: HasTree c_aEp4 l_aDPI p_aDPJ => Lens' c_aEp4 l_aDPI
+ Chiasma.Ui.Data.View: _treeData :: HasTree c_a1CE7 l_a1C12 p_a1C13 => Lens' c_a1CE7 l_a1C12
- Chiasma.Ui.Data.View: _treeSubs :: HasTree c_aEp4 l_aDPI p_aDPJ => Lens' c_aEp4 [TreeSub l_aDPI p_aDPJ]
+ Chiasma.Ui.Data.View: _treeSubs :: HasTree c_a1CE7 l_a1C12 p_a1C13 => Lens' c_a1CE7 [TreeSub l_a1C12 p_a1C13]
- Chiasma.Ui.Data.View: class HasLayout c_aDkB
+ Chiasma.Ui.Data.View: class HasLayout c_a1Bgj
- Chiasma.Ui.Data.View: class HasPane c_aDad
+ Chiasma.Ui.Data.View: class HasPane c_a1B52
- Chiasma.Ui.Data.View: class HasTree c_aEp4 l_aDPI p_aDPJ | c_aEp4 -> l_aDPI p_aDPJ
+ Chiasma.Ui.Data.View: class HasTree c_a1CE7 l_a1C12 p_a1C13 | c_a1CE7 -> l_a1C12 p_a1C13
- Chiasma.Ui.Data.View: class HasTreeSub c_aEsb l_aDPG p_aDPH | c_aEsb -> l_aDPG p_aDPH
+ Chiasma.Ui.Data.View: class HasTreeSub c_a1CHo l_a1C10 p_a1C11 | c_a1CHo -> l_a1C10 p_a1C11
- Chiasma.Ui.Data.View: class HasView c_aDOV a_aDkM | c_aDOV -> a_aDkM
+ Chiasma.Ui.Data.View: class HasView c_a1C0f a_a1Bgu | c_a1C0f -> a_a1Bgu
- Chiasma.Ui.Data.View: consLayoutAs :: Bool -> Ident -> LayoutView
+ Chiasma.Ui.Data.View: consLayoutAs :: Axis -> Ident -> LayoutView
- Chiasma.Ui.Data.View: cwd :: HasPane c_aDad => Lens' c_aDad (Maybe FilePath)
+ Chiasma.Ui.Data.View: cwd :: HasPane c_a1B52 => Lens' c_a1B52 (Maybe Text)
- Chiasma.Ui.Data.View: extra :: HasView c_aDOV a_aDkM => Lens' c_aDOV a_aDkM
+ Chiasma.Ui.Data.View: extra :: HasView c_a1C0f a_a1Bgu => Lens' c_a1C0f a_a1Bgu
- Chiasma.Ui.Data.View: geometry :: HasView c_aDOV a_aDkM => Lens' c_aDOV ViewGeometry
+ Chiasma.Ui.Data.View: geometry :: HasView c_a1C0f a_a1Bgu => Lens' c_a1C0f ViewGeometry
- Chiasma.Ui.Data.View: ident :: HasView c_aDOV a_aDkM => Lens' c_aDOV Ident
+ Chiasma.Ui.Data.View: ident :: HasView c_a1C0f a_a1Bgu => Lens' c_a1C0f Ident
- Chiasma.Ui.Data.View: layout :: HasLayout c_aDkB => Lens' c_aDkB Layout
+ Chiasma.Ui.Data.View: layout :: HasLayout c_a1Bgj => Lens' c_a1Bgj Layout
- Chiasma.Ui.Data.View: leafData :: HasTreeSub c_aEsb l_aDPG p_aDPH => Traversal' c_aEsb p_aDPH
+ Chiasma.Ui.Data.View: leafData :: HasTreeSub c_a1CHo l_a1C10 p_a1C11 => Traversal' c_a1CHo p_a1C11
- Chiasma.Ui.Data.View: open :: HasPane c_aDad => Lens' c_aDad Bool
+ Chiasma.Ui.Data.View: open :: HasPane c_a1B52 => Lens' c_a1B52 Bool
- Chiasma.Ui.Data.View: pane :: HasPane c_aDad => Lens' c_aDad Pane
+ Chiasma.Ui.Data.View: pane :: HasPane c_a1B52 => Lens' c_a1B52 Pane
- Chiasma.Ui.Data.View: pin :: HasPane c_aDad => Lens' c_aDad Bool
+ Chiasma.Ui.Data.View: pin :: HasPane c_a1B52 => Lens' c_a1B52 Bool
- Chiasma.Ui.Data.View: state :: HasView c_aDOV a_aDkM => Lens' c_aDOV ViewState
+ Chiasma.Ui.Data.View: state :: HasView c_a1C0f a_a1Bgu => Lens' c_a1C0f ViewState
- Chiasma.Ui.Data.View: subTree :: HasTreeSub c_aEsb l_aDPG p_aDPH => Traversal' c_aEsb (Tree l_aDPG p_aDPH)
+ Chiasma.Ui.Data.View: subTree :: HasTreeSub c_a1CHo l_a1C10 p_a1C11 => Traversal' c_a1CHo (Tree l_a1C10 p_a1C11)
- Chiasma.Ui.Data.View: tree :: HasTree c_aEp4 l_aDPI p_aDPJ => Lens' c_aEp4 (Tree l_aDPI p_aDPJ)
+ Chiasma.Ui.Data.View: tree :: HasTree c_a1CE7 l_a1C12 p_a1C13 => Lens' c_a1CE7 (Tree l_a1C12 p_a1C13)
- Chiasma.Ui.Data.View: treeSub :: HasTreeSub c_aEsb l_aDPG p_aDPH => Lens' c_aEsb (TreeSub l_aDPG p_aDPH)
+ Chiasma.Ui.Data.View: treeSub :: HasTreeSub c_a1CHo l_a1C10 p_a1C11 => Lens' c_a1CHo (TreeSub l_a1C10 p_a1C11)
- Chiasma.Ui.Data.View: view :: HasView c_aDOV a_aDkM => Lens' c_aDOV (View a_aDkM)
+ Chiasma.Ui.Data.View: view :: HasView c_a1C0f a_a1Bgu => Lens' c_a1C0f (View a_a1Bgu)
- Chiasma.Ui.Measure: measureLayout :: RenderableTree -> Int -> Int -> Bool -> MeasureTree
+ Chiasma.Ui.Measure: measureLayout :: RenderableTree -> Int -> Int -> Axis -> MeasureTree
- Chiasma.Ui.Measure: measureSub :: Int -> Int -> Bool -> RenderableNode -> Int -> MeasureTreeSub
+ Chiasma.Ui.Measure: measureSub :: Int -> Int -> Axis -> RenderableNode -> Int -> MeasureTreeSub
- Chiasma.View: addView :: MonadDeepState s Views m => Setter a -> Ident -> m (View a)
+ Chiasma.View: addView :: Member (AtomicState Views) r => Setter a -> Ident -> Sem r (View a)
- Chiasma.View: findOrCreateView :: MonadDeepState s Views m => Getter a -> Setter a -> Ident -> m (View a)
+ Chiasma.View: findOrCreateView :: Member (AtomicState Views) r => Getter a -> Setter a -> Ident -> Sem r (View a)
- Chiasma.View: viewsLog :: MonadDeepState s Views m => Doc AnsiStyle -> m ()
+ Chiasma.View: viewsLog :: Member (AtomicState Views) r => Doc AnsiStyle -> Sem r ()
- Chiasma.View: viewsLogS :: MonadDeepState s Views m => Text -> m ()
+ Chiasma.View: viewsLogS :: Member (AtomicState Views) r => Text -> Sem r ()
- Chiasma.View.State: paneId :: (MonadDeepState s Views m, MonadDeepError e ViewsError m) => Ident -> m PaneId
+ Chiasma.View.State: paneId :: Members [AtomicState Views, Stop ViewsError] r => Ident -> Sem r PaneId
- Chiasma.Window: ensurePane :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => FilePath -> WindowId -> PaneView -> m (Maybe RenderableNode)
+ Chiasma.Window: ensurePane :: Members [TmuxPanes Pane, AtomicState Views, Tmux] r => Path Abs Dir -> WindowId -> PaneView -> Sem r (Maybe RenderableNode)
- Chiasma.Window: ensurePaneClosed :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => Maybe PaneDetail -> m ()
+ Chiasma.Window: ensurePaneClosed :: Members [AtomicState Views, Tmux] r => Maybe Pane -> Sem r ()
- Chiasma.Window: ensurePaneOpen :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => FilePath -> Maybe PaneDetail -> WindowId -> m PaneDetail
+ Chiasma.Window: ensurePaneOpen :: Members [AtomicState Views, Tmux] r => Path Abs Dir -> Maybe Pane -> WindowId -> Sem r Pane
- Chiasma.Window: ensureView :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => FilePath -> WindowId -> ViewTree -> m (Maybe RenderableTree)
+ Chiasma.Window: ensureView :: Members [TmuxPanes Pane, AtomicState Views, Tmux] r => Path Abs Dir -> WindowId -> ViewTree -> Sem r (Maybe RenderableTree)
- Chiasma.Window: ensureWindow :: (MonadDeepState s Views m, MonadFree TmuxThunk m, MonadError RenderError m) => SessionId -> View WindowId -> Maybe WindowId -> ViewTree -> m Window
+ Chiasma.Window: ensureWindow :: Members [TmuxPanes Pane, AtomicState Views, Tmux, Stop RenderError] r => SessionId -> View WindowId -> Maybe WindowId -> ViewTree -> Sem r Window
- Chiasma.Window: findOrCreatePane :: MonadDeepState s Views m => Ident -> m (View PaneId)
+ Chiasma.Window: findOrCreatePane :: Member (AtomicState Views) r => Ident -> Sem r (View PaneId)
- Chiasma.Window: findOrCreateWindow :: MonadDeepState s Views m => Ident -> m (View WindowId)
+ Chiasma.Window: findOrCreateWindow :: Member (AtomicState Views) r => Ident -> Sem r (View WindowId)
- Chiasma.Window: nativePane :: MonadFree TmuxThunk m => WindowId -> View PaneId -> m (Maybe PaneDetail)
+ Chiasma.Window: nativePane :: Member (TmuxPanes Pane) r => WindowId -> View PaneId -> Sem r (Maybe Pane)
- Chiasma.Window: openPane :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => FilePath -> WindowId -> m PaneDetail
+ Chiasma.Window: openPane :: Members [AtomicState Views, Tmux] r => Path Abs Dir -> WindowId -> Sem r Pane
- Chiasma.Window: principalPane :: (MonadDeepState s Views m, MonadError RenderError m) => ViewTree -> m (PaneView, View PaneId)
+ Chiasma.Window: principalPane :: Members [AtomicState Views, Tmux, Stop RenderError] r => ViewTree -> Sem r (PaneView, View PaneId)
- Chiasma.Window: registerWindowId :: MonadDeepState s Views m => Ident -> WindowId -> m ()
+ Chiasma.Window: registerWindowId :: Member (AtomicState Views) r => Ident -> WindowId -> Sem r ()
- Chiasma.Window: renderableTree :: ViewState -> ViewGeometry -> Bool -> [RenderableNode] -> Maybe RenderableTree
+ Chiasma.Window: renderableTree :: ViewState -> ViewGeometry -> Axis -> [RenderableNode] -> Maybe RenderableTree
- Chiasma.Window: spawnWindow :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => SessionId -> Ident -> m Window
+ Chiasma.Window: spawnWindow :: Members [AtomicState Views, Tmux] r => SessionId -> Ident -> Sem r Window
- Chiasma.Window: syncPrincipal :: (MonadDeepState s Views m, MonadFree TmuxThunk m, MonadError RenderError m) => WindowId -> ViewTree -> m ()
+ Chiasma.Window: syncPrincipal :: Members [TmuxPanes Pane, AtomicState Views, Tmux, Stop RenderError] r => WindowId -> ViewTree -> Sem r ()
- Chiasma.Window: windowState :: (MonadDeepState s Views m, MonadFree TmuxThunk m) => Ident -> Window -> RenderableTree -> m WindowState
+ Chiasma.Window: windowState :: Member (TmuxPanes Pane) r => Ident -> Window -> RenderableTree -> Sem r WindowState

Files

LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2020 Torsten Schmits+Copyright (c) 2022 Torsten Schmits  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
chiasma.cabal view
@@ -1,37 +1,36 @@ cabal-version: 2.2 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.34.7. -- -- see: https://github.com/sol/hpack  name:           chiasma-version:        0.2.0.0-synopsis:       tmux api-description:    Please see the README on GitHub at <https://github.com/tek/chiasma>+version:        0.10.0.0+synopsis:       A tmux client for Polysemy+description:    See https://hackage.haskell.org/package/chiasma/docs/Chiasma.html category:       Terminal-homepage:       https://github.com/tek/chiasma-hs#readme-bug-reports:    https://github.com/tek/chiasma-hs/issues+homepage:       https://github.com/tek/chiasma#readme+bug-reports:    https://github.com/tek/chiasma/issues author:         Torsten Schmits-maintainer:     tek@tryp.io-copyright:      2021 Torsten Schmits+maintainer:     hackage@tryp.io+copyright:      2022 Torsten Schmits license:        BSD-2-Clause-Patent license-file:   LICENSE build-type:     Simple-extra-source-files:-    readme.md  source-repository head   type: git-  location: https://github.com/tek/chiasma-hs+  location: https://github.com/tek/chiasma  library   exposed-modules:-      Chiasma.Api.Class+      Chiasma+      Chiasma.Class.CmdArgs       Chiasma.Codec       Chiasma.Codec.Data+      Chiasma.Codec.Data.Client       Chiasma.Codec.Data.Pane       Chiasma.Codec.Data.PaneCoords-      Chiasma.Codec.Data.PaneDetail       Chiasma.Codec.Data.PaneMode       Chiasma.Codec.Data.PanePid       Chiasma.Codec.Data.Session@@ -42,36 +41,71 @@       Chiasma.Command.Session       Chiasma.Command.Window       Chiasma.Control.IO.Unsafe+      Chiasma.Data.Axis+      Chiasma.Data.CapturePaneParams       Chiasma.Data.Cmd-      Chiasma.Data.Conduit+      Chiasma.Data.CodecError+      Chiasma.Data.CopyModeParams+      Chiasma.Data.DecodeError+      Chiasma.Data.Direction+      Chiasma.Data.Event       Chiasma.Data.Ident+      Chiasma.Data.KillPaneParams+      Chiasma.Data.LayoutError       Chiasma.Data.List-      Chiasma.Data.Maybe+      Chiasma.Data.Panes+      Chiasma.Data.PaneSelection+      Chiasma.Data.PipePaneParams+      Chiasma.Data.ProcessError+      Chiasma.Data.ReceiveEvent       Chiasma.Data.RenderError+      Chiasma.Data.ResizePaneParams+      Chiasma.Data.SelectParams+      Chiasma.Data.SelectWindowParams+      Chiasma.Data.SendKeysParams+      Chiasma.Data.SessionGroupId+      Chiasma.Data.SessionParams+      Chiasma.Data.SplitParams+      Chiasma.Data.Target+      Chiasma.Data.TmuxCommand       Chiasma.Data.TmuxError       Chiasma.Data.TmuxId+      Chiasma.Data.TmuxNative+      Chiasma.Data.TmuxOutputBlock+      Chiasma.Data.TmuxQuery+      Chiasma.Data.TmuxRequest+      Chiasma.Data.TmuxResponse       Chiasma.Data.TmuxThunk       Chiasma.Data.View       Chiasma.Data.Views+      Chiasma.Data.WindowParams+      Chiasma.Data.WindowSelection       Chiasma.Data.WindowState+      Chiasma.Data.WithPaneId+      Chiasma.Effect.Codec+      Chiasma.Effect.TmuxApi+      Chiasma.Effect.TmuxClient+      Chiasma.Event+      Chiasma.Function+      Chiasma.Interpreter.Codec+      Chiasma.Interpreter.ProcessOutput+      Chiasma.Interpreter.Pure+      Chiasma.Interpreter.TmuxApi+      Chiasma.Interpreter.TmuxClient       Chiasma.Lens.Tree       Chiasma.Lens.Where       Chiasma.Monad.EvalFreeT-      Chiasma.Monad.IndividualProcess-      Chiasma.Monad.Stream       Chiasma.Monad.Tmux-      Chiasma.Native.Api       Chiasma.Native.Parse-      Chiasma.Native.Process-      Chiasma.Native.StreamParse+      Chiasma.Native.TmuxOutputBlock       Chiasma.Pack       Chiasma.Pane-      Chiasma.Prelude+      Chiasma.Path       Chiasma.Render       Chiasma.Session-      Chiasma.Test.File-      Chiasma.Test.Screenshot-      Chiasma.Test.Tmux+      Chiasma.Tmux+      Chiasma.TmuxApi+      Chiasma.TmuxNative       Chiasma.Ui.Data.Measure       Chiasma.Ui.Data.RenderableTree       Chiasma.Ui.Data.Tree@@ -89,14 +123,10 @@       Chiasma.View       Chiasma.View.State       Chiasma.Window-  other-modules:-      Prelude-      Paths_chiasma-  autogen-modules:-      Paths_chiasma   hs-source-dirs:       lib   default-extensions:+      ImpredicativeTypes       AllowAmbiguousTypes       ApplicativeDo       BangPatterns@@ -110,11 +140,14 @@       DeriveFoldable       DeriveFunctor       DeriveGeneric+      DeriveLift       DeriveTraversable       DerivingStrategies+      DerivingVia       DisambiguateRecordFields       DoAndIfThenElse       DuplicateRecordFields+      EmptyCase       EmptyDataDecls       ExistentialQuantification       FlexibleContexts@@ -129,120 +162,9 @@       MultiParamTypeClasses       MultiWayIf       NamedFieldPuns-      OverloadedStrings+      OverloadedLabels       OverloadedLists-      PackageImports-      PartialTypeSignatures-      PatternGuards-      PatternSynonyms-      PolyKinds-      QuantifiedConstraints-      QuasiQuotes-      RankNTypes-      RecordWildCards-      RecursiveDo-      ScopedTypeVariables-      StandaloneDeriving-      TemplateHaskell-      TupleSections-      TypeApplications-      TypeFamilies-      TypeFamilyDependencies-      TypeOperators-      TypeSynonymInstances-      UndecidableInstances-      UnicodeSyntax-      ViewPatterns-  build-depends:-      aeson >=1.4 && <1.6-    , attoparsec ==0.13.*-    , base ==4.*-    , bytestring-    , composition ==1.0.*-    , composition-extra ==2.0.*-    , conduit ==1.3.*-    , conduit-extra ==1.3.*-    , containers-    , cornea ==0.4.*-    , data-default ==0.7.*-    , deepseq-    , directory-    , either >=5.0.1 && <5.1-    , exceptions-    , filepath-    , free ==5.1.*-    , lens ==4.*-    , mtl-    , parsec-    , parsers ==0.12.*-    , posix-pty ==0.2.*-    , prettyprinter >=1.6 && <1.8-    , prettyprinter-ansi-terminal ==1.1.*-    , process ==1.6.*-    , random ==1.1.*-    , relude >=0.7 && <1.2-    , resourcet ==1.2.*-    , split ==0.2.*-    , stm-chans ==3.0.*-    , stm-conduit ==4.0.*-    , text-    , transformers-    , typed-process ==0.2.*-    , unix-    , unliftio ==0.2.*-    , unliftio-core >=0.1 && <0.3-    , uuid ==1.3.*-  mixins:-      base hiding (Prelude)-  default-language: Haskell2010--test-suite chiasma-integration-  type: exitcode-stdio-1.0-  main-is: Main.hs-  other-modules:-      Chiasma.Test.IndividualProcessTest-      Chiasma.Test.ProcessTest-      Chiasma.Test.RenderTest-      Chiasma.Test.TmuxStreamTest-      Chiasma.Test.Util-      Paths_chiasma-  hs-source-dirs:-      integration-  default-extensions:-      AllowAmbiguousTypes-      ApplicativeDo-      BangPatterns-      BinaryLiterals-      BlockArguments-      ConstraintKinds-      DataKinds-      DefaultSignatures-      DeriveAnyClass-      DeriveDataTypeable-      DeriveFoldable-      DeriveFunctor-      DeriveGeneric-      DeriveTraversable-      DerivingStrategies-      DisambiguateRecordFields-      DoAndIfThenElse-      DuplicateRecordFields-      EmptyDataDecls-      ExistentialQuantification-      FlexibleContexts-      FlexibleInstances-      FunctionalDependencies-      GADTs-      GeneralizedNewtypeDeriving-      InstanceSigs-      KindSignatures-      LambdaCase-      LiberalTypeSynonyms-      MultiParamTypeClasses-      MultiWayIf-      NamedFieldPuns       OverloadedStrings-      OverloadedLists       PackageImports       PartialTypeSignatures       PatternGuards@@ -253,126 +175,7 @@       RankNTypes       RecordWildCards       RecursiveDo-      ScopedTypeVariables-      StandaloneDeriving-      TemplateHaskell-      TupleSections-      TypeApplications-      TypeFamilies-      TypeFamilyDependencies-      TypeOperators-      TypeSynonymInstances-      UndecidableInstances-      UnicodeSyntax-      ViewPatterns-  ghc-options: -threaded -rtsopts -with-rtsopts=-N-  build-depends:-      aeson >=1.4 && <1.6-    , attoparsec ==0.13.*-    , base ==4.*-    , bytestring-    , chiasma-    , composition ==1.0.*-    , composition-extra ==2.0.*-    , conduit ==1.3.*-    , conduit-extra ==1.3.*-    , containers-    , cornea ==0.4.*-    , data-default ==0.7.*-    , deepseq-    , directory-    , either >=5.0.1 && <5.1-    , exceptions-    , filepath-    , free ==5.1.*-    , hedgehog-    , lens ==4.*-    , mtl-    , parsec-    , parsers ==0.12.*-    , posix-pty ==0.2.*-    , prettyprinter >=1.6 && <1.8-    , prettyprinter-ansi-terminal ==1.1.*-    , process ==1.6.*-    , random ==1.1.*-    , relude >=0.7 && <1.2-    , resourcet ==1.2.*-    , split ==0.2.*-    , stm-chans ==3.0.*-    , stm-conduit ==4.0.*-    , tasty-    , tasty-hedgehog-    , text-    , transformers-    , typed-process ==0.2.*-    , unix-    , unliftio ==0.2.*-    , unliftio-core >=0.1 && <0.3-    , uuid ==1.3.*-  mixins:-      base hiding (Prelude)-    , chiasma (Chiasma.Prelude as Prelude)-    , chiasma hiding (Chiasma.Prelude)-  default-language: Haskell2010--test-suite chiasma-unit-  type: exitcode-stdio-1.0-  main-is: Main.hs-  other-modules:-      Chiasma.Test.CodecTest-      Chiasma.Test.LensTest-      Chiasma.Test.OutputParseTest-      Chiasma.Test.PinTest-      Chiasma.Test.StreamParseTest-      Chiasma.Test.Util-      Paths_chiasma-  hs-source-dirs:-      test-  default-extensions:-      AllowAmbiguousTypes-      ApplicativeDo-      BangPatterns-      BinaryLiterals-      BlockArguments-      ConstraintKinds-      DataKinds-      DefaultSignatures-      DeriveAnyClass-      DeriveDataTypeable-      DeriveFoldable-      DeriveFunctor-      DeriveGeneric-      DeriveTraversable-      DerivingStrategies-      DisambiguateRecordFields-      DoAndIfThenElse-      DuplicateRecordFields-      EmptyDataDecls-      ExistentialQuantification-      FlexibleContexts-      FlexibleInstances-      FunctionalDependencies-      GADTs-      GeneralizedNewtypeDeriving-      InstanceSigs-      KindSignatures-      LambdaCase-      LiberalTypeSynonyms-      MultiParamTypeClasses-      MultiWayIf-      NamedFieldPuns-      OverloadedStrings-      OverloadedLists-      PackageImports-      PartialTypeSignatures-      PatternGuards-      PatternSynonyms-      PolyKinds-      QuantifiedConstraints-      QuasiQuotes-      RankNTypes-      RecordWildCards-      RecursiveDo+      RoleAnnotations       ScopedTypeVariables       StandaloneDeriving       TemplateHaskell@@ -385,52 +188,36 @@       UndecidableInstances       UnicodeSyntax       ViewPatterns-  ghc-options: -threaded -rtsopts -with-rtsopts=-N+  ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wmissing-deriving-strategies -Widentities -Wunused-packages -fplugin=Polysemy.Plugin   build-depends:-      aeson >=1.4 && <1.6-    , attoparsec ==0.13.*-    , base ==4.*+      attoparsec >=0.13+    , base >=4.12 && <5     , bytestring-    , chiasma-    , composition ==1.0.*-    , composition-extra ==2.0.*-    , conduit ==1.3.*-    , conduit-extra ==1.3.*+    , composition >=1.0     , containers-    , cornea ==0.4.*-    , data-default ==0.7.*-    , deepseq-    , directory-    , either >=5.0.1 && <5.1-    , exceptions-    , filepath-    , free ==5.1.*-    , hedgehog-    , lens ==4.*-    , mtl+    , exon+    , extra+    , first-class-families+    , lens >=4     , parsec-    , parsers ==0.12.*-    , posix-pty ==0.2.*-    , prettyprinter >=1.6 && <1.8-    , prettyprinter-ansi-terminal ==1.1.*-    , process ==1.6.*-    , random ==1.1.*-    , relude >=0.7 && <1.2-    , resourcet ==1.2.*-    , split ==0.2.*-    , stm-chans ==3.0.*-    , stm-conduit ==4.0.*-    , tasty-    , tasty-hedgehog+    , parsers >=0.12+    , path+    , polysemy+    , polysemy-conc >=0.9+    , polysemy-log >=0.7+    , polysemy-plugin+    , polysemy-process >=0.9+    , polysemy-time >=0.5+    , prelate >=0.2+    , prettyprinter >=1.6+    , prettyprinter-ansi-terminal >=1.1+    , random >=1.1     , text     , transformers-    , typed-process ==0.2.*-    , unix-    , unliftio ==0.2.*-    , unliftio-core >=0.1 && <0.3-    , uuid ==1.3.*+    , typed-process >=0.2+    , uuid >=1.3   mixins:       base hiding (Prelude)-    , chiasma (Chiasma.Prelude as Prelude)-    , chiasma hiding (Chiasma.Prelude)+    , prelate (Prelate as Prelude)+    , prelate hiding (Prelate)   default-language: Haskell2010
− integration/Chiasma/Test/IndividualProcessTest.hs
@@ -1,42 +0,0 @@-module Chiasma.Test.IndividualProcessTest where--import Chiasma.Codec.Data (Pane(Pane), Window(Window))-import Chiasma.Data.TmuxError (TmuxError)-import Chiasma.Data.TmuxId (PaneId(..), WindowId(..))-import Chiasma.Monad.IndividualProcess (TmuxProg, runTmux)-import qualified Chiasma.Monad.Tmux as Tmux (read, write)-import Chiasma.Native.Api (TmuxNative(..))-import Hedgehog ((===))--import Chiasma.Test.Tmux (tmuxSpec)-import Chiasma.Test.Util (UnitTest)--prog :: TmuxProg ([Pane], [Pane], [Window])-prog = do-  panes1 <- Tmux.read "list-panes" ["-t", "%0"]-  Tmux.write "new-window" []-  Tmux.write "new-window" []-  wins <- Tmux.read "list-windows" []-  panes <- Tmux.read "list-panes" ["-a"]-  return (panes1, panes, wins)--p :: Int -> Pane-p i = Pane (PaneId i) 240 60--w :: Int -> Window-w i = Window (WindowId i) 240 60--runProg :: TmuxNative -> IO (Either TmuxError ([Pane], [Pane], [Window]))-runProg api = runExceptT $ runTmux api prog--test_individual :: UnitTest-test_individual = do-  result :: Either TmuxError ([Pane], [Pane], [Window]) <- liftIO (tmuxSpec runProg)-  Right ([p0], [p0, p1, p2], [w0, w1, w2]) === result-  where-    p0 = p 0-    p1 = p 1-    p2 = p 2-    w0 = w 0-    w1 = w 1-    w2 = w 2
− integration/Chiasma/Test/ProcessTest.hs
@@ -1,42 +0,0 @@-module Chiasma.Test.ProcessTest where--import Chiasma.Data.Conduit (createSinkFlush)-import Chiasma.Native.Api (TmuxNative(..))-import Chiasma.Native.Process (socketArg)-import Conduit (ConduitT, Flush(..), mapC, runConduit, sinkList, yieldMany, (.|))-import Data.ByteString.Internal (packChars)-import qualified Data.Conduit.Combinators as Conduit (concatMap, take)-import Data.Conduit.Process.Typed (-  Process,-  createSource,-  getStdin,-  getStdout,-  proc,-  setStdin,-  setStdout,-  withProcessTerm,-  )-import qualified Data.Text as Text (splitOn)-import Hedgehog (assert)--import Chiasma.Test.Tmux (tmuxSpec)-import Chiasma.Test.Util (UnitTest)--run :: Process (ConduitT (Flush ByteString) Void IO ()) (ConduitT () ByteString IO ()) () -> IO [Text]-run prc = do-  let stdin' = mapC (fmap packChars) .| getStdin prc-  let stdout' = getStdout prc-  runConduit $ yieldMany ([Chunk "list-panes\n"] :: [Flush String]) .| stdin'-  runConduit $ yieldMany ([Flush] :: [Flush String]) .| stdin'-  runConduit $ stdout' .| Conduit.take 2 .| mapC decodeUtf8 .| Conduit.concatMap (Text.splitOn "\n") .| sinkList--test_process :: UnitTest-test_process = do-  out <- liftIO $ tmuxSpec $ \(TmuxNative sock) -> do-    withProcessTerm (pc (args sock)) run-  assert (length out > 3)-    where-      pc =-        setStdin createSinkFlush . setStdout createSource . proc "tmux"-      args sock =-        toString <$> socketArg sock ++ ["-C", "attach"]
− integration/Chiasma/Test/RenderTest.hs
@@ -1,216 +0,0 @@-module Chiasma.Test.RenderTest where--import Chiasma.Codec.Data.PaneDetail (PaneDetail(..))-import Chiasma.Command.Pane (panesAs)-import Chiasma.Command.Session (activateSession)-import Chiasma.Data.Ident (Ident(Str))-import Chiasma.Data.TmuxError (TmuxError)-import Chiasma.Data.TmuxId (PaneId(PaneId), SessionId(SessionId), WindowId(WindowId))-import Chiasma.Data.View (viewIdent)-import qualified Chiasma.Data.View as Tmux (View(View))-import Chiasma.Data.Views (Views(Views))-import Chiasma.Monad.Stream (runTmux)-import Chiasma.Native.Api (TmuxNative(..))-import Chiasma.Render (render)-import Chiasma.Ui.Data.View (Tree(..), TreeSub(..), ViewTree, consLayout, consLayoutVertical)-import qualified Chiasma.Ui.Data.View as Ui (Pane(Pane), View(View))-import Chiasma.Ui.Data.ViewGeometry (ViewGeometry(..))-import Chiasma.Ui.Data.ViewState (ViewState(ViewState))-import Chiasma.Ui.ViewTree (togglePane)-import qualified Chiasma.Ui.ViewTree as ToggleResult (ToggleResult(Success))-import Hedgehog (evalEither, (===))-import Test.Tasty (TestTree, testGroup)-import UnliftIO (throwString)-import UnliftIO.Directory (getCurrentDirectory)--import Chiasma.Test.Tmux (sleep, tmuxSpec)-import Chiasma.Test.Util (UnitTest, integrationTest)--id0, id1, id2, id3 :: Ident-id0 = Str "0"-id1 = Str "1"-id2 = Str "2"-id3 = Str "3"--views :: Views-views =-  Views-    [Tmux.View id0 (Just (SessionId 0))]-    [Tmux.View id0 (Just (WindowId 0))]-    [Tmux.View id0 (Just (PaneId 0))]-    []--renderOnce :: ViewTree -> TmuxNative -> FilePath -> Views -> IO Views-renderOnce tree api cwd vs = do-  r <- runExceptT $ runStateT (runTmux api $ render cwd id1 id1 tree) vs-  either (throwString . show) (return . snd) r--safeRender :: Views -> ViewTree -> TmuxNative -> IO Views-safeRender vs tree api = do-  cwd <- getCurrentDirectory-  vs1 <- renderOnce tree api cwd vs-  _ <- runExceptT @TmuxError $ runTmux api $ activateSession 0-  _ <- runExceptT @TmuxError $ runTmux api $ activateSession 1-  sleep 1-  renderOnce tree api cwd vs1--runRender :: ViewTree -> TmuxNative -> IO ([Tmux.View PaneId], Either TmuxError [PaneDetail])-runRender tree api = do-  (Views _ _ vs2 _) <- safeRender views tree api-  sleep 1-  ps <- runExceptT @TmuxError $ runTmux api panesAs-  return (sortOn viewIdent vs2, sortOn paneLeft . drop 1 <$> ps)--renderSpec :: ViewTree -> [PaneDetail] -> UnitTest-renderSpec tree target = do-  (_, pse) <- liftIO $ tmuxSpec $ runRender tree-  ps <- evalEither pse-  target === ps--treeImbalanced :: ViewTree-treeImbalanced =-  Tree (consLayout id0) [-    TreeLeaf (openPane id0 def),-    TreeLeaf (openPane id1 (ViewGeometry Nothing Nothing (Just 150) Nothing Nothing Nothing))-    ]-  where-    openPane i geo = Ui.View i (ViewState False) geo (Ui.Pane True False Nothing)--imbalancedTarget :: [PaneDetail]-imbalancedTarget =-  [-    PaneDetail { paneId = PaneId 1, paneWidth = 89, paneHeight = 60, paneTop = 0, paneLeft = 0 },-    PaneDetail { paneId = PaneId 2, paneWidth = 150, paneHeight = 60, paneTop = 0, paneLeft = 90 }-    ]--test_imbalanced :: UnitTest-test_imbalanced =-  renderSpec treeImbalanced imbalancedTarget--treeNested :: ViewTree-treeNested =-  Tree (consLayoutVertical id0) [-    TreeNode $-      Tree (consLayout id1) [-        TreeLeaf (openPane id0 def),-        TreeNode $-          Tree (consLayoutVertical id2) [-            TreeLeaf (openPane id1 def),-            TreeLeaf (openPane id2 def)-            ]-        ]-    ]-  where-    openPane i geo = Ui.View i (ViewState False) geo (Ui.Pane True False Nothing)--nestedTarget :: [PaneDetail]-nestedTarget =-  [-    PaneDetail { paneId = PaneId 1, paneWidth = 120, paneHeight = 60, paneTop = 0, paneLeft = 0 },-    PaneDetail { paneId = PaneId 2, paneWidth = 119, paneHeight = 30, paneTop = 0, paneLeft = 121 },-    PaneDetail { paneId = PaneId 3, paneWidth = 119, paneHeight = 29, paneTop = 31, paneLeft = 121 }-  ]--test_nested :: UnitTest-test_nested =-  renderSpec treeNested nestedTarget--treeTwoLayouts :: ViewTree-treeTwoLayouts =-  Tree (consLayout id0) [-    TreeNode $-      Tree (consLayoutVertical id1) [-        TreeLeaf (openPane id0 def)-        ],-    TreeNode $-      Tree (consLayoutVertical id2) [-        TreeLeaf (openPane id1 def)-        ]-    ]-  where-    openPane i geo = Ui.View i (ViewState False) geo (Ui.Pane True False Nothing)--twoLayoutsTarget :: [PaneDetail]-twoLayoutsTarget =-  [-    PaneDetail { paneId = PaneId 1, paneWidth = 120, paneHeight = 60, paneTop = 0, paneLeft = 0 },-    PaneDetail { paneId = PaneId 2, paneWidth = 119, paneHeight = 60, paneTop = 0, paneLeft = 121 }-    ]--test_twoLayouts :: UnitTest-test_twoLayouts =-  renderSpec treeTwoLayouts twoLayoutsTarget--treePosition :: ViewTree-treePosition =-  Tree (consLayout id0) [-    TreeLeaf (openPane id0 1 (Just 10)),-    TreeLeaf (openPane id1 4 (Just 20)),-    TreeLeaf (openPane id2 2 (Just 30)),-    TreeLeaf (openPane id3 3 Nothing)-    ]-  where-    openPane i pos size =-      Ui.View i (ViewState False) def { position = Just pos, fixedSize = size } (Ui.Pane True False Nothing)--positionTarget :: [PaneDetail]-positionTarget =-  [-    PaneDetail { paneId = PaneId 1, paneWidth = 10, paneHeight = 60, paneTop = 0, paneLeft = 0 },-    PaneDetail { paneId = PaneId 2, paneWidth = 30, paneHeight = 60, paneTop = 0, paneLeft = 11 },-    PaneDetail { paneId = PaneId 3, paneWidth = 177, paneHeight = 60, paneTop = 0, paneLeft = 42 },-    PaneDetail { paneId = PaneId 4, paneWidth = 20, paneHeight = 60, paneTop = 0, paneLeft = 220 }-    ]--test_position :: UnitTest-test_position =-  renderSpec treePosition positionTarget--treeSuccessiveOpen :: ViewTree-treeSuccessiveOpen =-  Tree (consLayout id0) [-    TreeNode $ Tree (consLayoutVertical id1) [-      TreeLeaf (pane id0 True False)-      ],-    TreeNode $ Tree (consLayoutVertical id2) [-      TreeLeaf (pane id1 False True),-      TreeLeaf (pane id2 False False)-      ]-    ]-  where-    pane i open pin =-      Ui.View i (ViewState False) def (Ui.Pane open pin Nothing)--successiveOpenTarget :: [PaneDetail]-successiveOpenTarget =-  [-    PaneDetail { paneId = PaneId 1, paneWidth = 120, paneHeight = 60, paneTop = 0, paneLeft = 0 },-    PaneDetail { paneId = PaneId 2, paneWidth = 119, paneHeight = 30, paneTop = 0, paneLeft = 121 },-    PaneDetail { paneId = PaneId 3, paneWidth = 119, paneHeight = 29, paneTop = 31, paneLeft = 121 }-    ]--test_successiveOpen :: UnitTest-test_successiveOpen = do-  ps <- liftIO $ tmuxSpec \ api -> do-    vs1 <- safeRender views treeSuccessiveOpen api-    sleep 0.2-    vs2 <- safeRender vs1 tree1 api-    sleep 0.2-    _ <- safeRender vs2 tree2 api-    sleep 0.2-    runExceptT @TmuxError $ runTmux api panesAs-  ps1 <- evalEither (sortOn paneId . drop 1 <$> ps)-  successiveOpenTarget === ps1-  where-    (ToggleResult.Success tree2) = togglePane id2 tree1-    (ToggleResult.Success tree1) = togglePane id1 treeSuccessiveOpen--test_render :: TestTree-test_render =-  testGroup "render" [-    integrationTest "imbalanced tree" test_imbalanced,-    integrationTest "nested panes" test_nested,-    integrationTest "two layouts" test_twoLayouts,-    integrationTest "fixed pane position" test_position,-    integrationTest "open multiple panes" test_successiveOpen-  ]
− integration/Chiasma/Test/TmuxStreamTest.hs
@@ -1,44 +0,0 @@-module Chiasma.Test.TmuxStreamTest where--import Chiasma.Codec.Data (Pane(Pane), Window(Window))-import Chiasma.Data.TmuxError (TmuxError)-import Chiasma.Data.TmuxId (PaneId(..), WindowId(..))-import Chiasma.Data.TmuxThunk (TmuxThunk)-import Chiasma.Monad.Stream (runTmux)-import qualified Chiasma.Monad.Tmux as Tmux (read, write)-import Chiasma.Native.Api (TmuxNative(..))-import Control.Monad.Free.Class (MonadFree)-import Hedgehog ((===))--import Chiasma.Test.Tmux (tmuxSpec)-import Chiasma.Test.Util (UnitTest)--prog :: MonadFree TmuxThunk m => m ([Pane], [Pane], [Window])-prog = do-  panes1 <- Tmux.read "list-panes" ["-t", "%0"]-  Tmux.write "new-window" []-  Tmux.write "new-window" []-  wins <- Tmux.read "list-windows" []-  panes <- Tmux.read "list-panes" ["-a"]-  return (panes1, panes, wins)--p :: Int -> Pane-p i = Pane (PaneId i) 240 60--w :: Int -> Window-w i = Window (WindowId i) 240 60--runProg :: TmuxNative -> IO (Either TmuxError ([Pane], [Pane], [Window]))-runProg api = runExceptT @TmuxError $ runTmux api prog--test_streamed :: UnitTest-test_streamed = do-  result <- liftIO (tmuxSpec runProg)-  (Right ([p0], [p0, p1, p2], [w0, w1, w2])) === result-  where-    p0 = p 0-    p1 = p 1-    p2 = p 2-    w0 = w 0-    w1 = w 1-    w2 = w 2
− integration/Chiasma/Test/Util.hs
@@ -1,19 +0,0 @@-module Chiasma.Test.Util where--import Hedgehog (TestT, withTests, property, test)-import Test.Tasty (TestName, TestTree)-import Test.Tasty.Hedgehog (testProperty)-import qualified System.Environment as Environment--type UnitTest = TestT IO ()--checkEnv :: UnitTest -> UnitTest-checkEnv t =-  maybe unit (const t) =<< liftIO (Environment.lookupEnv "DISPLAY")--integrationTest ::-  TestName ->-  UnitTest ->-  TestTree-integrationTest desc =-  testProperty desc . withTests 1 . property . test . checkEnv
− integration/Main.hs
@@ -1,21 +0,0 @@-module Main where--import Chiasma.Test.IndividualProcessTest (test_individual)-import Chiasma.Test.ProcessTest (test_process)-import Chiasma.Test.RenderTest (test_render)-import Chiasma.Test.TmuxStreamTest (test_streamed)-import Chiasma.Test.Util (integrationTest)-import Test.Tasty (TestTree, defaultMain, testGroup)--tests :: TestTree-tests =-  testGroup "all" [-    integrationTest "use individual subprocesses for queries" test_individual,-    integrationTest "tmux control process" test_process,-    test_render,-    integrationTest "streamed tmux commands" test_streamed-  ]--main :: IO ()-main =-  defaultMain tests
+ lib/Chiasma.hs view
@@ -0,0 +1,12 @@+module Chiasma (+  TmuxApi,+  Tmux,+  Codec,+  NativeCodec,+  NativeCodecE,+  NativeCommandCodec,+  NativeCommandCodecE,+) where++import Chiasma.Effect.Codec (Codec, NativeCodec, NativeCodecE, NativeCommandCodec, NativeCommandCodecE)+import Chiasma.Effect.TmuxApi (Tmux, TmuxApi)
− lib/Chiasma/Api/Class.hs
@@ -1,19 +0,0 @@-module Chiasma.Api.Class where--import Conduit (ConduitT, Flush)--import Chiasma.Codec.Decode (TmuxDecodeError)-import Chiasma.Data.Cmd (Cmd, Cmds)-import Chiasma.Native.StreamParse (TmuxOutputBlock)--class TmuxApi m a where-  runCommands ::-    a ->-    (Text -> Either TmuxDecodeError b) ->-    Cmds ->-    m [b]--  withTmux ::-    a ->-    (ConduitT (Flush Cmd) Void m () -> ConduitT () TmuxOutputBlock m () -> m b) ->-    m b
+ lib/Chiasma/Class/CmdArgs.hs view
@@ -0,0 +1,55 @@+module Chiasma.Class.CmdArgs where++import qualified Data.Map.Strict as Map+import Exon (exon)++import Chiasma.Data.Ident (Ident, identText)++class CmdArgs a where+  cmdArgs :: a -> [Text]++flag :: [Text] -> Bool -> [Text]+flag =+  bool []++flag1 :: Text -> Bool -> [Text]+flag1 =+  flag . pure++optionWith :: Text -> (a -> Text) -> Maybe a -> [Text]+optionWith flg f =+  foldMap \ a -> [flg, f a]++option :: Text -> Maybe Text -> [Text]+option flg =+  optionWith flg id++identOption :: Text -> Maybe Ident -> [Text]+identOption flg =+  optionWith flg identText++arg :: Maybe Text -> [Text]+arg =+  maybeToList++envVars :: Map Text Text -> [Text]+envVars =+  concatMap \case+    (k, v) -> ["-e", [exon|#{k}=#{v}|]]+  .+  Map.toList++optionArgs ::+  CmdArgs a =>+  Maybe a ->+  [Text]+optionArgs =+  foldMap cmdArgs++optionArgsWith ::+  CmdArgs a =>+  Text ->+  Maybe a ->+  [Text]+optionArgsWith flg =+  foldMap \ a -> flg : cmdArgs a
lib/Chiasma/Codec.hs view
@@ -1,37 +1,74 @@ module Chiasma.Codec where -import Chiasma.Data.TmuxId (PaneId, SessionId, WindowId)-import qualified Data.Text as Text (drop, dropEnd, splitOn, take, takeEnd, unwords)+import qualified Data.Text as Text import GHC.Generics (Rep, to)+import Prelude hiding (to) -import Chiasma.Codec.Decode (TmuxDataDecode(..), TmuxDecodeError(TooManyFields))-import Chiasma.Codec.Query (TmuxDataQuery(..))+import Chiasma.Codec.Decode (TmuxDataDecode (..))+import Chiasma.Codec.Query (TmuxDataQuery (..))+import qualified Chiasma.Data.DecodeError as DecodeFailure (DecodeFailure (..))+import Chiasma.Data.DecodeError (DecodeError (DecodeError), DecodeFailure)+import Chiasma.Data.TmuxId (PaneId, SessionId, WindowId)+import Chiasma.Data.TmuxQuery (TmuxQuery (TmuxQuery)) -newtype TmuxQuery =-  TmuxQuery { unQ :: Text }-  deriving (Eq, Show)+-- |Remove one leading and trailing space from tmux output if both are present.+tryTrim :: Text -> Maybe Text+tryTrim text = do+  (prefix, lastChar) <- Text.unsnoc text+  guard (lastChar == ' ')+  (firstChar, payload) <- Text.uncons prefix+  guard (firstChar == ' ')+  pure payload -genDecode :: (Generic a, TmuxDataDecode (Rep a)) => Text -> Either TmuxDecodeError a+trim :: Text -> Text+trim text =+  fromMaybe text (tryTrim text)++checkRemainder :: ([Text], b) -> Either DecodeFailure b+checkRemainder = \case+  ([], result) -> Right result+  (a, _) -> Left (DecodeFailure.TooManyFields a)++genDecode ::+  Generic a =>+  TmuxDataDecode (Rep a) =>+  Text ->+  Either DecodeError a genDecode fields = do-  (rest, result) <- decode' (Text.splitOn " " . trim $ fields)-  case rest of-    [] -> return $ to result-    a -> Left $ TooManyFields a-  where-    trim text =-      if Text.take 1 text == " " && Text.takeEnd 1 text == " "-      then Text.drop 1 . Text.dropEnd 1 $ text-      else text+  bimap (DecodeError [fields]) to do+    checkRemainder =<< dataDecode (Text.splitOn " " (trim fields))  class TmuxCodec a where-    decode :: Text -> Either TmuxDecodeError a-    default decode :: (Generic a, TmuxDataDecode (Rep a)) => Text -> Either TmuxDecodeError a-    decode = genDecode+  decode :: Text -> Either DecodeError a+  default decode ::+    Generic a =>+    TmuxDataDecode (Rep a) =>+    Text ->+    Either DecodeError a+  decode =+    genDecode -    query :: TmuxQuery-    default query :: TmuxDataQuery (Rep a) => TmuxQuery-    query = TmuxQuery $ Text.unwords $ query' @(Rep a)+  query :: TmuxQuery+  default query :: TmuxDataQuery (Rep a) => TmuxQuery+  query =+    TmuxQuery (Text.unwords (dataQuery @(Rep a)))  instance TmuxCodec SessionId instance TmuxCodec WindowId instance TmuxCodec PaneId++multi ::+  TmuxCodec a =>+  [Text] ->+  Either DecodeError [a]+multi =+  traverse decode++single ::+  TmuxCodec a =>+  [Text] ->+  Either DecodeError a+single = \case+  [out] -> decode out+  [] -> Left (DecodeError [] DecodeFailure.TargetMissing)+  out -> Left (DecodeError out (DecodeFailure.TooManyRecords out))
+ lib/Chiasma/Codec/Data/Client.hs view
@@ -0,0 +1,13 @@+module Chiasma.Codec.Data.Client where++import Chiasma.Codec (TmuxCodec)+import Chiasma.Data.TmuxId (ClientId, SessionId)++data Client =+  Client {+    clientName :: ClientId,+    clientControlMode :: Bool,+    sessionId :: SessionId+  }+  deriving stock (Eq, Show, Generic)+  deriving anyclass (TmuxCodec)
lib/Chiasma/Codec/Data/Pane.hs view
@@ -2,15 +2,18 @@  import Chiasma.Codec (TmuxCodec) import Chiasma.Data.TmuxId (HasPaneId, PaneId)-import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId(..))+import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId (..))  data Pane =   Pane {     paneId :: PaneId,     paneWidth :: Int,-    paneHeight :: Int+    paneHeight :: Int,+    paneTop :: Int,+    paneLeft :: Int   }-  deriving (Eq, Show, Generic, TmuxCodec)+  deriving stock (Eq, Show, Generic)+  deriving anyclass (TmuxCodec)  instance HasPaneId Pane where   paneId = paneId
lib/Chiasma/Codec/Data/PaneCoords.hs view
@@ -1,9 +1,8 @@ module Chiasma.Codec.Data.PaneCoords where -import Chiasma.Data.TmuxId (HasPaneId, PaneId, SessionId, WindowId)-import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId(..))- import Chiasma.Codec (TmuxCodec)+import Chiasma.Data.TmuxId (HasPaneId, PaneId, SessionId, WindowId)+import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId (..))  data PaneCoords =   PaneCoords {@@ -11,7 +10,8 @@     windowId :: WindowId,     paneId :: PaneId   }-  deriving (Eq, Show, Generic, TmuxCodec)+  deriving stock (Eq, Show, Generic)+  deriving anyclass (TmuxCodec)  instance HasPaneId PaneCoords where   paneId = paneId
− lib/Chiasma/Codec/Data/PaneDetail.hs
@@ -1,18 +0,0 @@-module Chiasma.Codec.Data.PaneDetail where--import Chiasma.Codec (TmuxCodec)-import Chiasma.Data.TmuxId (HasPaneId, PaneId)-import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId(..))--data PaneDetail =-  PaneDetail {-    paneId :: PaneId,-    paneWidth :: Int,-    paneHeight :: Int,-    paneTop :: Int,-    paneLeft :: Int-  }-  deriving (Eq, Show, Generic, TmuxCodec)--instance HasPaneId PaneDetail where-  paneId = paneId
lib/Chiasma/Codec/Data/PaneMode.hs view
@@ -2,14 +2,15 @@  import Chiasma.Codec (TmuxCodec) import Chiasma.Data.TmuxId (HasPaneId, PaneId)-import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId(paneId))+import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId (paneId))  data PaneMode =   PaneMode {     paneId :: PaneId,     paneMode :: Text   }-  deriving (Eq, Show, Generic, TmuxCodec)+  deriving stock (Eq, Show, Generic)+  deriving anyclass (TmuxCodec)  instance HasPaneId PaneMode where   paneId = paneId
lib/Chiasma/Codec/Data/PanePid.hs view
@@ -2,14 +2,15 @@  import Chiasma.Codec (TmuxCodec) import Chiasma.Data.TmuxId (HasPaneId, PaneId)-import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId(paneId))+import qualified Chiasma.Data.TmuxId as HasPaneId (HasPaneId (paneId))  data PanePid =   PanePid {     paneId :: PaneId,     panePid :: Int   }-  deriving (Eq, Show, Generic, TmuxCodec)+  deriving stock (Eq, Show, Generic)+  deriving anyclass (TmuxCodec)  instance HasPaneId PanePid where   paneId = paneId
lib/Chiasma/Codec/Data/Session.hs view
@@ -6,6 +6,8 @@ -- must be data for now because of how derivation of `TmuxCodec` is implemented data Session =   Session {-    sessionId :: SessionId+    sessionId :: SessionId,+    sessionName :: Text   }-  deriving (Eq, Show, Generic, TmuxCodec)+  deriving stock (Eq, Show, Generic)+  deriving anyclass (TmuxCodec)
lib/Chiasma/Codec/Data/Window.hs view
@@ -9,4 +9,5 @@     windowWidth :: Int,     windowHeight :: Int   }-  deriving (Eq, Show, Generic, TmuxCodec)+  deriving stock (Eq, Show, Generic)+  deriving anyclass (TmuxCodec)
lib/Chiasma/Codec/Decode.hs view
@@ -1,58 +1,48 @@-{-# LANGUAGE TypeOperators #-}- module Chiasma.Codec.Decode where  import qualified Data.Text as Text (null, unpack) import Data.Text.Read (decimal)-import GHC.Generics (K1(..), M1(..), (:*:)(..))+import GHC.Generics (K1 (..), M1 (..), (:*:) (..)) import Prelude hiding (many)-import Text.Parsec.Char (char, digit)-import Text.ParserCombinators.Parsec (-  GenParser,-  ParseError,-  many,-  parse,-  )--import Chiasma.Data.TmuxId (PaneId(..), SessionId(..), WindowId(..), panePrefix, sessionPrefix, windowPrefix)+import Text.Parsec.Char (digit, string)+import Text.ParserCombinators.Parsec (GenParser, many, parse) -data TmuxDecodeError =-  ParseFailure Text ParseError-  |-  IntParsingFailure Text-  |-  BoolParsingFailure Text-  |-  TooFewFields-  |-  TooManyFields [Text]-  deriving (Eq, Show)+import Chiasma.Data.DecodeError (DecodeFailure (BoolParsingFailure, IntParsingFailure, ParseFailure, TooFewFields))+import Chiasma.Data.TmuxId (+  ClientId (ClientId),+  PaneId (..),+  SessionId (..),+  WindowId (..),+  panePrefix,+  sessionPrefix,+  windowPrefix,+  )  class TmuxPrimDecode a where-  primDecode :: Text -> Either TmuxDecodeError a+  primDecode :: Text -> Either DecodeFailure a  class TmuxDataDecode f where-  decode' :: [Text] -> Either TmuxDecodeError ([Text], f a)+  dataDecode :: [Text] -> Either DecodeFailure ([Text], f a)  instance (TmuxDataDecode f, TmuxDataDecode g) => TmuxDataDecode (f :*: g) where-  decode' fields = do-    (rest, left) <- decode' fields-    (rest1, right) <- decode' rest-    return (rest1, left :*: right)+  dataDecode fields = do+    (rest, left) <- dataDecode fields+    (rest1, right) <- dataDecode rest+    pure (rest1, left :*: right)  instance TmuxDataDecode f => (TmuxDataDecode (M1 i c f)) where-  decode' fields =-    second M1 <$> decode' fields+  dataDecode fields =+    second M1 <$> dataDecode fields  instance TmuxPrimDecode a => (TmuxDataDecode (K1 c a)) where-  decode' (a:as) = do+  dataDecode (a:as') = do     prim <- primDecode a-    return (as, K1 prim)-  decode' [] = Left TooFewFields+    pure (as', K1 prim)+  dataDecode [] = Left TooFewFields -readInt :: Text -> Text -> Either TmuxDecodeError Int-readInt input num =-  first (const $ IntParsingFailure input) parsed+readInt :: Text -> Text -> Either DecodeFailure Int+readInt text num =+  first (const $ IntParsingFailure text) parsed   where     parsed = do       (num', rest) <- decimal num@@ -72,15 +62,18 @@       convert _ =         Left (BoolParsingFailure $ "got non-bool `" <> show field <> "`") -idParser :: Char -> GenParser Char st Text+idParser :: Text -> GenParser Char st Text idParser sym =-  char sym *> (toText <$> many digit)+  string (toString sym) *> (toText <$> many digit) -parseId :: (Int -> a) -> Char -> Text -> Either TmuxDecodeError a-parseId cons sym input = do-  num <- first (ParseFailure "id") $ parse (idParser sym) "none" (Text.unpack input)-  i <- readInt input num-  return $ cons i+parseId :: (Int -> a) -> Text -> Text -> Either DecodeFailure a+parseId cons sym text = do+  num <- first (ParseFailure "id") $ parse (idParser sym) "none" (Text.unpack text)+  i <- readInt text num+  pure (cons i)++instance TmuxPrimDecode ClientId where+  primDecode = pure . ClientId  instance TmuxPrimDecode SessionId where   primDecode = parseId SessionId sessionPrefix
lib/Chiasma/Codec/Query.hs view
@@ -1,6 +1,3 @@-{-# LANGUAGE AllowAmbiguousTypes #-}-{-# LANGUAGE TypeOperators #-}- module Chiasma.Codec.Query where  import Data.Char (isUpper, toLower)@@ -8,16 +5,16 @@ import GHC.Generics (C1, D1, S1, Selector, selName, (:*:))  class TmuxDataQuery f where-  query' :: [Text]+  dataQuery :: [Text]  instance TmuxDataQuery f => (TmuxDataQuery (D1 c f)) where-  query' = query' @f+  dataQuery = dataQuery @f  instance TmuxDataQuery f => (TmuxDataQuery (C1 c f)) where-  query' = query' @f+  dataQuery = dataQuery @f  instance (TmuxDataQuery f, TmuxDataQuery g) => TmuxDataQuery (f :*: g) where-  query' = query' @f <> query' @g+  dataQuery = dataQuery @f <> dataQuery @g  trans :: Char -> Text trans a | isUpper a = toText @String ['_', toLower a]@@ -31,7 +28,7 @@ formatQuery q = "#{" <> snakeCase q <> "}"  instance Selector s => (TmuxDataQuery (S1 s f)) where-  query' =+  dataQuery =     [formatQuery (toText query)]     where       query = selName (undefined :: t s f p)
lib/Chiasma/Command/Pane.hs view
@@ -1,173 +1,160 @@ module Chiasma.Command.Pane where -import Data.List (dropWhileEnd)-import qualified Data.Text as Text (intercalate, singleton, splitOn)--import Chiasma.Codec (TmuxCodec)-import qualified Chiasma.Codec.Data as Codec (Pane)-import qualified Chiasma.Codec.Data.PaneCoords as Codec (PaneCoords)-import qualified Chiasma.Codec.Data.PaneMode as Codec (PaneMode(PaneMode))-import qualified Chiasma.Codec.Data.PanePid as Codec (PanePid)-import Chiasma.Data.TmuxId (HasPaneId, PaneId, WindowId, formatId)-import qualified Chiasma.Data.TmuxId as HasPaneId (paneId)-import Chiasma.Data.TmuxThunk (TmuxThunk)-import Chiasma.Data.View (View(View))-import qualified Chiasma.Monad.Tmux as Tmux (read, readRaw, unsafeReadFirst, write)-import Control.Monad.Free.Class (MonadFree)--paneTarget :: PaneId -> [Text]-paneTarget paneId =-  ["-t", formatId paneId]--sameId :: HasPaneId a => PaneId -> a -> Bool-sameId target candidate = target == HasPaneId.paneId candidate+import Prelude hiding (output) -panesAs :: (MonadFree TmuxThunk m, TmuxCodec a) => m [a]-panesAs =-  Tmux.read "list-panes" ["-a"]+import qualified Chiasma.Codec.Data.Pane as Codec (Pane)+import qualified Chiasma.Codec.Data.PaneMode as Codec (PaneMode (PaneMode))+import Chiasma.Data.Axis (Axis)+import Chiasma.Data.CapturePaneParams (CaptureOutput (Stdout), escapeSequences, output, target)+import Chiasma.Data.CopyModeParams (target)+import Chiasma.Data.KillPaneParams (target)+import qualified Chiasma.Data.PaneSelection as PaneSelection+import qualified Chiasma.Data.Panes as Panes+import Chiasma.Data.Panes (TmuxPanes)+import Chiasma.Data.PipePaneParams (command, target)+import Chiasma.Data.ResizePaneParams (ResizeAbsolute (ResizeAbsolute), absolute, target)+import Chiasma.Data.SelectParams (target)+import qualified Chiasma.Data.SendKeysParams as SendKeysParams+import Chiasma.Data.SendKeysParams (Key, keys, target)+import Chiasma.Data.SplitParams (JoinPaneParams (axis, detach, source, target))+import qualified Chiasma.Data.Target as Target+import Chiasma.Data.TmuxCommand (+  TmuxCommand (CapturePane, CopyMode, KillPane, MovePane, PipePane, ResizePane, SelectPane, SendKeys),+  )+import Chiasma.Data.TmuxId (PaneId, WindowId)+import Chiasma.Data.View (View (View))+import qualified Chiasma.Effect.TmuxApi as Tmux+import Chiasma.Effect.TmuxApi (Tmux) -panes :: MonadFree TmuxThunk m => m [Codec.Pane]+panes ::+  Member (TmuxPanes a) r =>+  Sem r [a] panes =-  panesAs+  Tmux.send (Panes.List PaneSelection.All) -pane :: (MonadFree TmuxThunk m, TmuxCodec a, HasPaneId a) => PaneId -> m (Maybe a)+pane ::+  Member (TmuxPanes a) r =>+  PaneId ->+  Sem r (Maybe a) pane paneId =-  find (sameId paneId) <$> Tmux.read "list-panes" ["-t", formatId paneId]--windowPanesAs :: (MonadFree TmuxThunk m, TmuxCodec a) => WindowId -> m [a]-windowPanesAs windowId =-  Tmux.read "list-panes" ["-t", formatId windowId]+  Tmux.send (Panes.Find paneId) -windowPanes :: MonadFree TmuxThunk m => WindowId -> m [Codec.Pane]-windowPanes =-  windowPanesAs+windowPanes ::+  Member (TmuxPanes a) r =>+  WindowId ->+  Sem r [a]+windowPanes windowId =+  Tmux.send (Panes.List (PaneSelection.InWindow (Target.Window windowId))) -firstWindowPane :: MonadFree TmuxThunk m => WindowId -> m Codec.Pane+firstWindowPane ::+  Member (TmuxPanes a) r =>+  WindowId ->+  Sem r a firstWindowPane windowId =-  Tmux.unsafeReadFirst "list-panes" ["-t", formatId windowId]+  Tmux.send (Panes.First (PaneSelection.InWindow (Target.Window windowId))) -closePane :: MonadFree TmuxThunk m => PaneId -> m ()+closePane ::+  Member Tmux r =>+  PaneId ->+  Sem r () closePane paneId =-  Tmux.write "kill-pane" (paneTarget paneId)+  Tmux.send (KillPane def { target = Target.Pane paneId })  isPaneIdOpen ::-  MonadFree TmuxThunk m =>+  Member (TmuxPanes Codec.Pane) r =>   PaneId ->-  m Bool+  Sem r Bool isPaneIdOpen paneId =-  any (sameId paneId) <$> panes+  isJust <$> pane paneId  isPaneOpen ::-  MonadFree TmuxThunk m =>+  Member (TmuxPanes Codec.Pane) r =>   View PaneId ->-  m Bool+  Sem r Bool isPaneOpen (View _ (Just paneId)) =   isPaneIdOpen paneId-isPaneOpen _ = return False+isPaneOpen _ =+  pure False  movePane ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>   PaneId ->   PaneId ->-  Bool ->-  m ()-movePane paneId refId vertical =-  Tmux.write "move-pane" ["-d", "-s", formatId paneId, "-t", formatId refId, direction]-  where-    direction = if vertical then "-v" else "-h"+  Axis ->+  Sem r ()+movePane paneId refId axis =+  Tmux.send (MovePane def {+    detach = True,+    source = Just (Target.Pane paneId),+    target = Target.Pane refId,+    axis = Just axis+  })  resizePane ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>   PaneId ->-  Bool ->+  Axis ->   Int ->-  m ()-resizePane paneId vertical size =-  Tmux.write "resize-pane" ["-t", formatId paneId, direction, show size]-  where-    direction = if vertical then "-y" else "-x"--formatLine :: Text -> [Text]-formatLine line =-  ["\"" <> replace "\"" "\\\"" line <> Text.singleton '"', "enter"]-  where-    replace from to =-      Text.intercalate to . Text.splitOn from+  Sem r ()+resizePane paneId axis size =+  Tmux.send (ResizePane def {+    target = Target.Pane paneId,+    absolute = Just (ResizeAbsolute axis size)+  })  sendKeys ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>   PaneId ->-  [Text] ->-  m ()+  [Key] ->+  Sem r () sendKeys paneId lines' =-  traverse_ send formatted-  where-    formatted = lines' >>= formatLine-    send line = Tmux.write "send-keys" (paneTarget paneId <> [line])+  for_ lines' \ line ->+    Tmux.send (SendKeys def { target = Target.Pane paneId, keys = [line] })  pipePane ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>   PaneId ->   Text ->-  m ()+  Sem r () pipePane paneId cmd =-  Tmux.write "pipe-pane" (paneTarget paneId <> [cmd])+  Tmux.schedule (PipePane def { target = Target.Pane paneId, command = Just cmd })  capturePane ::-  MonadFree TmuxThunk m =>-  PaneId ->-  m [Text]-capturePane paneId = do-  lines' <- Tmux.readRaw "capture-pane" (paneTarget paneId <> ["-p", "-e"])-  return $ dropWhileEnd ("" ==) lines'--panePid ::-  MonadFree TmuxThunk m =>-  PaneId ->-  m (Maybe Codec.PanePid)-panePid =-  pane--panePids ::-  MonadFree TmuxThunk m =>-  m [Codec.PanePid]-panePids =-  panesAs--paneCoords ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>   PaneId ->-  m (Maybe Codec.PaneCoords)-paneCoords =-  pane+  Sem r [Text]+capturePane paneId =+  Tmux.send (CapturePane def { target = Target.Pane paneId, escapeSequences = True, output = Just Stdout})  selectPane ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>   PaneId ->-  m ()+  Sem r () selectPane paneId =-  Tmux.write "select-pane" (paneTarget paneId)+  Tmux.send (SelectPane def { target = Target.Pane paneId })  copyMode ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>   PaneId ->-  m ()-copyMode =-  Tmux.write "copy-mode" . paneTarget+  Sem r ()+copyMode paneId =+  Tmux.send (CopyMode def { target = Target.Pane paneId })  paneMode ::-  MonadFree TmuxThunk m =>+  Member (TmuxPanes Codec.PaneMode) r =>   PaneId ->-  m (Maybe Codec.PaneMode)+  Sem r (Maybe Codec.PaneMode) paneMode =   pane  quitCopyMode ::-  MonadFree TmuxThunk m =>+  Member Tmux r =>+  Member (TmuxPanes Codec.PaneMode) r =>   PaneId ->-  m ()+  Sem r () quitCopyMode paneId =   traverse_ check =<< pane paneId   where     check (Codec.PaneMode _ mode) =-      when (mode == "copy-mode") (sendKeys paneId ["C-c"])+      when (mode == "copy-mode") do+        Tmux.send (SendKeys def { target = Target.Pane paneId, SendKeysParams.copyMode = True, keys = ["cancel"] })
lib/Chiasma/Command/Session.hs view
@@ -1,33 +1,61 @@ module Chiasma.Command.Session where -import Control.Monad.Free.Class (MonadFree)--import Chiasma.Codec.Data (Session(Session))-import Chiasma.Data.Ident (Ident, identText)+import Chiasma.Codec.Data.Client (Client (Client))+import Chiasma.Codec.Data.Session (Session (Session))+import Chiasma.Data.Ident (Ident)+import Chiasma.Data.SessionParams (name)+import qualified Chiasma.Data.Target as Target+import Chiasma.Data.TmuxCommand (TmuxCommand (ListClients, ListSessions, NewSession, SwitchClient))+import Chiasma.Data.TmuxError (TmuxError (NoClients)) import Chiasma.Data.TmuxId (SessionId)-import Chiasma.Data.TmuxThunk (TmuxThunk)-import qualified Chiasma.Monad.Tmux as Tmux (read, unsafeReadOne, write)+import qualified Chiasma.Effect.TmuxApi as Tmux+import Chiasma.Effect.TmuxApi (Tmux)  sameId :: SessionId -> Session -> Bool-sameId target (Session i) = target == i+sameId target (Session i _) = target == i -sessions :: MonadFree TmuxThunk m => m [Session]+sessions ::+  Member Tmux r =>+  Sem r [Session] sessions =-  Tmux.read "list-sessions" []+  Tmux.send ListSessions -doesSessionExist :: MonadFree TmuxThunk m => SessionId -> m Bool+doesSessionExist ::+  Member Tmux r =>+  SessionId ->+  Sem r Bool doesSessionExist sessionId =   any (sameId sessionId) <$> sessions -existingSessionId :: MonadFree TmuxThunk m => SessionId -> m (Maybe SessionId)+existingSessionId ::+  Member Tmux r =>+  SessionId ->+  Sem r (Maybe SessionId) existingSessionId sessionId = do   exists <- doesSessionExist sessionId-  return $ if exists then Just sessionId else Nothing+  pure $ if exists then Just sessionId else Nothing -newSession :: MonadFree TmuxThunk m => Ident -> m Session+newSession ::+  Member Tmux r =>+  Ident ->+  Sem r Session newSession name =-  Tmux.unsafeReadOne "new-session" ["-s", identText name, "-P"]+  Tmux.send (NewSession def { name = Just name }) -activateSession :: MonadFree TmuxThunk m => Int -> m ()-activateSession sessionId =-  Tmux.write "send-keys" ["-t", "%1", "'tmux switch-client -t \\$" <> show sessionId <> "'", "enter"]+clientForSession :: SessionId -> [Client] -> Maybe Client+clientForSession session =+  find \case+    Client _ False sid ->+      sid == session+    _ ->+      False++switchClient ::+  Members [Tmux, Stop TmuxError] r =>+  SessionId ->+  SessionId ->+  Sem r ()+switchClient clientSession session = do+  clients <- Tmux.send ListClients+  Client client _ _ <- stopNote NoClients (clientForSession clientSession clients)+  Tmux.send (SwitchClient client (Target.Session session))
lib/Chiasma/Command/Window.hs view
@@ -1,53 +1,79 @@ module Chiasma.Command.Window where -import Control.Monad.Free.Class (MonadFree)+import Exon (exon)+import Path (Abs, Dir, Path) -import Chiasma.Codec (TmuxCodec)-import Chiasma.Codec.Data (Pane, Window(Window))-import Chiasma.Data.Ident (Ident, identText)-import Chiasma.Data.TmuxId (SessionId, TmuxId(formatId), WindowId)-import Chiasma.Data.TmuxThunk (TmuxThunk)-import qualified Chiasma.Monad.Tmux as Tmux (read, unsafeReadFirst, unsafeReadOne)+import Chiasma.Codec.Data.Pane (Pane)+import Chiasma.Codec.Data.Window (Window (Window))+import Chiasma.Data.Ident (Ident)+import Chiasma.Data.LayoutError (LayoutError (LayoutError))+import qualified Chiasma.Data.Target as Target+import Chiasma.Data.TmuxCommand (TmuxCommand (ListWindows, NewWindow, SplitWindow))+import Chiasma.Data.TmuxId (SessionId, WindowId)+import Chiasma.Data.WindowParams (cwd, detach, name, target)+import qualified Chiasma.Data.WindowSelection as WindowSelection+import qualified Chiasma.Effect.TmuxApi as Tmux+import Chiasma.Effect.TmuxApi (Tmux)  sameId :: WindowId -> Window -> Bool sameId target (Window i _ _) = target == i -windows :: MonadFree TmuxThunk m => m [Window]+windows ::+  Member Tmux r =>+  Sem r [Window] windows =-  Tmux.read "list-windows" ["-a"]+  Tmux.send (ListWindows WindowSelection.All) -window :: MonadFree TmuxThunk m => WindowId -> m (Maybe Window)+window ::+  Member Tmux r =>+  WindowId ->+  Sem r (Maybe Window) window windowId =   find (sameId windowId) <$> windows -sessionWindows :: MonadFree TmuxThunk m => SessionId -> m [Window]+sessionWindows ::+  Member Tmux r =>+  SessionId ->+  Sem r [Window] sessionWindows sid =-  Tmux.read "list-windows" ["-t", formatId sid]+  Tmux.send (ListWindows (WindowSelection.InSession (Target.Session sid))) -newSessionWindow :: MonadFree TmuxThunk m => SessionId -> m Window+-- TODO this could be ListWindow+newSessionWindow ::+  Members [Tmux, Stop LayoutError] r =>+  SessionId ->+  Sem r Window newSessionWindow sid =-  Tmux.unsafeReadOne "list-windows" ["-t", formatId sid]+  sessionWindows sid >>= \case+    [w] -> pure w+    ws -> stop (LayoutError [exon|New session contains multiple windows: #{show ws}|]) -doesWindowExist :: MonadFree TmuxThunk m => WindowId -> m Bool+doesWindowExist ::+  Member Tmux r =>+  WindowId ->+  Sem r Bool doesWindowExist windowId =   any (sameId windowId) <$> windows -newWindow :: MonadFree TmuxThunk m => SessionId -> Ident -> m Window+newWindow ::+  Member Tmux r =>+  SessionId ->+  Ident ->+  Sem r Window newWindow sid name =-  Tmux.unsafeReadOne "new-window" ["-t", formatId sid, "-n", identText name, "-P"]+  Tmux.send (NewWindow def { target = Target.Session sid, name = Just name }) -splitWindowAs ::-  (MonadFree TmuxThunk m, TmuxCodec a) =>-  FilePath ->+splitWindowInDir ::+  Member Tmux r =>+  Path Abs Dir ->   WindowId ->-  m a-splitWindowAs dir windowId =-  Tmux.unsafeReadFirst "split-window" ["-t", formatId windowId, "-d", "-P", "-c", toText dir]+  Sem r Pane+splitWindowInDir dir windowId =+  Tmux.send (SplitWindow def { target = Target.Window windowId, detach = True, cwd = Just dir } def)  splitWindow ::-  (MonadFree TmuxThunk m) =>-  FilePath ->+  Member Tmux r =>   WindowId ->-  m Pane-splitWindow =-  splitWindowAs+  Sem r Pane+splitWindow windowId =+  Tmux.send (SplitWindow def { target = Target.Window windowId, detach = True } def)
lib/Chiasma/Control/IO/Unsafe.hs view
@@ -3,4 +3,4 @@ import GHC.IO.Unsafe (unsafePerformIO)  unsafeLog :: Show a => a -> b -> b-unsafeLog a b = unsafePerformIO $ print a >> return b+unsafeLog a b = unsafePerformIO $ print a >> pure b
+ lib/Chiasma/Data/Axis.hs view
@@ -0,0 +1,31 @@+module Chiasma.Data.Axis where++import Data.Data (Data)+import Prettyprinter (Pretty (pretty))++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs))++data Axis =+  Horizontal+  |+  Vertical+  deriving stock (Eq, Show, Data)++instance Pretty Axis where+  pretty = \case+    Horizontal -> "h"+    Vertical -> "v"++instance CmdArgs Axis where+  cmdArgs = \case+    Horizontal -> ["-h"]+    Vertical -> ["-v"]++instance Default Axis where+  def =+    Vertical++vertical :: Axis -> Bool+vertical = \case+  Horizontal -> False+  Vertical -> True
+ lib/Chiasma/Data/CapturePaneParams.hs view
@@ -0,0 +1,84 @@+module Chiasma.Data.CapturePaneParams where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), flag1, optionArgs, optionArgsWith)+import qualified Chiasma.Data.Target as Target+import Chiasma.Data.Target (Target)+import Prelude hiding (output)++data CaptureOutput =+  Stdout+  |+  Buffer Text+  deriving stock (Eq, Show)++instance CmdArgs CaptureOutput where+  cmdArgs = \case+    Stdout -> ["-p"]+    Buffer name -> ["-b", name]++data CaptureLine =+  Edge+  |+  CaptureLine Int+  deriving stock (Eq, Show)++instance CmdArgs CaptureLine where+  cmdArgs = \case+    Edge -> ["-"]+    CaptureLine n -> [show n]++data CapturePaneParams =+  CapturePaneParams {+    output :: Maybe CaptureOutput,+    alternate :: Bool,+    quiet :: Bool,+    escapeSequences :: Bool,+    octal :: Bool,+    joinWrapped :: Bool,+    incomplete :: Bool,+    startLine :: Maybe CaptureLine,+    endLine :: Maybe CaptureLine,+    target :: Target,+    stripBlank :: Bool,+    stripTrailingWs :: Bool+  }+  deriving stock (Eq, Show)++instance Default CapturePaneParams where+  def =+    CapturePaneParams {+      output = Nothing,+      alternate = False,+      quiet = False,+      escapeSequences = False,+      octal = False,+      joinWrapped = True,+      incomplete = False,+      startLine = Nothing,+      endLine = Nothing,+      target = Target.Current,+      stripBlank = True,+      stripTrailingWs = True+    }++instance CmdArgs CapturePaneParams where+  cmdArgs CapturePaneParams {..} =+    flag1 "-a" alternate+    <>+    flag1 "-q" quiet+    <>+    flag1 "-e" escapeSequences+    <>+    flag1 "-C" octal+    <>+    flag1 "-J" joinWrapped+    <>+    flag1 "-P" incomplete+    <>+    optionArgs output+    <>+    optionArgsWith "-S" startLine+    <>+    optionArgsWith "-E" endLine+    <>+    cmdArgs target
lib/Chiasma/Data/Cmd.hs view
@@ -8,19 +8,19 @@  newtype CmdName =   CmdName Text-  deriving (Eq, Show)+  deriving stock (Eq, Show)  newtype CmdArgs =   CmdArgs [Text]-  deriving (Eq, Show)+  deriving stock (Eq, Show)  data Cmd =   Cmd CmdName CmdArgs-  deriving (Eq, Show)+  deriving stock (Eq, Show)  newtype Cmds =   Cmds [Cmd]-  deriving (Eq, Show)+  deriving stock (Eq, Show)  cmd :: Text -> [Text] -> Cmd cmd name args = Cmd (CmdName name) (CmdArgs args)
+ lib/Chiasma/Data/CodecError.hs view
@@ -0,0 +1,8 @@+module Chiasma.Data.CodecError where++import Chiasma.Data.DecodeError (DecodeError)+import Chiasma.Data.TmuxRequest (TmuxRequest)++data CodecError =+  CodecError TmuxRequest DecodeError+  deriving stock (Eq, Show)
− lib/Chiasma/Data/Conduit.hs
@@ -1,10 +0,0 @@-{-# LANGUAGE DataKinds #-}--module Chiasma.Data.Conduit where--import Conduit (ConduitT, Flush)-import Data.Conduit.Binary (sinkHandleFlush)-import Data.Conduit.Process.Typed (StreamSpec, StreamType(STInput), createPipe)--createSinkFlush :: MonadIO m => StreamSpec 'STInput (ConduitT (Flush ByteString) o m ())-createSinkFlush = sinkHandleFlush <$> createPipe
+ lib/Chiasma/Data/CopyModeParams.hs view
@@ -0,0 +1,32 @@+module Chiasma.Data.CopyModeParams where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), flag1)+import Chiasma.Data.Target (Target)++data CopyModeParams =+  CopyModeParams {+    mouseDrag :: Bool,+    scrollUp :: Bool,+    exitBottom :: Bool,+    target :: Target+  }+  deriving stock (Eq, Show)++instance Default CopyModeParams where+  def =+    CopyModeParams {+      mouseDrag = False,+      scrollUp = False,+      exitBottom = False,+      target = def+    }++instance CmdArgs CopyModeParams where+  cmdArgs CopyModeParams {..} =+    flag1 "-M" mouseDrag+    <>+    flag1 "-u" scrollUp+    <>+    flag1 "-e" exitBottom+    <>+    cmdArgs target
+ lib/Chiasma/Data/DecodeError.hs view
@@ -0,0 +1,26 @@+module Chiasma.Data.DecodeError where++import Text.ParserCombinators.Parsec (ParseError)++data DecodeFailure =+  ParseFailure Text ParseError+  |+  IntParsingFailure Text+  |+  BoolParsingFailure Text+  |+  TooFewFields+  |+  TooManyFields [Text]+  |+  TooManyRecords [Text]+  |+  TargetMissing+  deriving stock (Eq, Show)++data DecodeError =+  DecodeError {+    output :: [Text],+    failure :: DecodeFailure+  }+  deriving stock (Eq, Show)
+ lib/Chiasma/Data/Direction.hs view
@@ -0,0 +1,22 @@+module Chiasma.Data.Direction where++import Prelude hiding (Down, Left, Right)++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs))++data Direction =+  Up+  |+  Down+  |+  Left+  |+  Right+  deriving stock (Eq, Show)++instance CmdArgs Direction where+  cmdArgs = \case+    Up -> ["-U"]+    Down -> ["-D"]+    Left -> ["-L"]+    Right -> ["-R"]
+ lib/Chiasma/Data/Event.hs view
@@ -0,0 +1,7 @@+module Chiasma.Data.Event where++import Chiasma.Data.TmuxId (WindowId)++data Event =+  WindowClosed WindowId+  deriving stock (Eq, Show)
lib/Chiasma/Data/Ident.hs view
@@ -1,21 +1,18 @@ module Chiasma.Data.Ident where -import Data.Aeson (FromJSON, ToJSON(toEncoding), defaultOptions, genericToEncoding) import Data.Data (Data)-import Data.Text.Prettyprint.Doc (Pretty(..)) import Data.UUID (UUID) import qualified Data.UUID as UUID (fromText, toText)+import Prettyprinter (Pretty (..)) import System.Random (randomIO)-import qualified Text.Show as Show  data Ident =   Str Text   |   Uuid UUID-  deriving (Eq, Generic, Data, NFData, Ord)+  deriving stock (Eq, Show, Ord, Generic, Data) -instance Show Ident where-  show = toString . identText+json ''Ident  class Identifiable a where   identify :: a -> Ident@@ -24,19 +21,18 @@   identify = id  instance Pretty Ident where-  pretty (Str s) = pretty s-  pretty (Uuid u) = pretty . UUID.toText $ u+  pretty =+    pretty . \case+      Str s -> s+      Uuid u -> UUID.toText u  instance Default Ident where-  def = Str ""+  def =+    Str ""  instance IsString Ident where-  fromString = Str . toText--instance FromJSON Ident where--instance ToJSON Ident where-  toEncoding = genericToEncoding defaultOptions+  fromString =+    Str . toText  sameIdent ::   Identifiable a =>
+ lib/Chiasma/Data/KillPaneParams.hs view
@@ -0,0 +1,24 @@+module Chiasma.Data.KillPaneParams where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), flag1)+import Chiasma.Data.Target (Target)++data KillPaneParams =+  KillPaneParams {+    allbut :: Bool,+    target :: Target+  }+  deriving stock (Eq, Show)++instance Default KillPaneParams where+  def =+    KillPaneParams {+      allbut = False,+      target = def+    }++instance CmdArgs KillPaneParams where+  cmdArgs KillPaneParams {..} =+    flag1 "-a" allbut+    <>+    cmdArgs target
+ lib/Chiasma/Data/LayoutError.hs view
@@ -0,0 +1,6 @@+module Chiasma.Data.LayoutError where++newtype LayoutError =+  LayoutError { unLayoutError :: Text }+  deriving stock (Eq, Show, Generic)+  deriving newtype (IsString)
− lib/Chiasma/Data/Maybe.hs
@@ -1,17 +0,0 @@-module Chiasma.Data.Maybe where--import Control.Monad.Error.Class (MonadError(throwError))--maybeExcept :: MonadError e m => e -> Maybe a -> m a-maybeExcept e Nothing = throwError e-maybeExcept _ (Just a) = return a--findMaybe :: (a -> Maybe b) -> [a] -> Maybe b-findMaybe f as =-  case mapMaybe f as of-    (a : _) -> Just a-    _ -> Nothing--orElse :: Maybe a -> Maybe a -> Maybe a-orElse _ (Just a) = Just a-orElse fallback Nothing = fallback
+ lib/Chiasma/Data/PaneSelection.hs view
@@ -0,0 +1,22 @@+module Chiasma.Data.PaneSelection where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs))+import Chiasma.Data.Target (Target (Current))++data PaneSelection =+  All+  |+  InSession Target+  |+  InWindow Target+  deriving stock (Eq, Show)++instance CmdArgs PaneSelection where+  cmdArgs = \case+    All -> ["-a"]+    InSession target -> ["-s"] <> cmdArgs target+    InWindow target -> cmdArgs target++instance Default PaneSelection where+  def =+    InWindow Current
+ lib/Chiasma/Data/Panes.hs view
@@ -0,0 +1,105 @@+module Chiasma.Data.Panes where++import Chiasma.Class.CmdArgs (cmdArgs)+import qualified Chiasma.Codec as Codec+import Chiasma.Codec (TmuxCodec, multi, single)+import qualified Chiasma.Data.DecodeError as DecodeFailure+import Chiasma.Data.DecodeError (DecodeError (DecodeError))+import qualified Chiasma.Data.PaneSelection as PaneSelection+import Chiasma.Data.PaneSelection (PaneSelection)+import qualified Chiasma.Data.Target as Target+import Chiasma.Data.TmuxId (PaneId)+import Chiasma.Data.TmuxQuery (TmuxQuery)+import Chiasma.Data.TmuxRequest (TmuxRequest (TmuxRequest))+import Chiasma.Data.TmuxResponse (TmuxResponse (TmuxResponse))+import Chiasma.Data.WithPaneId (WithPaneId (WithPaneId))+import Chiasma.Effect.TmuxApi (TmuxApi)++-- |A 'TmuxApi' command for listing panes, with different query criteria.+-- The constructors taking a 'PaneSelection' list all panes that are present in the selected scope, but may constrain+-- the return value.+-- The constructors 'Get' and 'Find' return only the pane with the requested ID.+data Panes (p :: Type) (a :: Type) :: Type where+  -- |Return all panes covered by the selection.+  List :: PaneSelection -> Panes p [p]+  -- |Return one pane covered by the selection, fail if there is none.+  First :: PaneSelection -> Panes p p+  -- |Return one pane covered by the selection, fail if there is none or more than one.+  One :: PaneSelection -> Panes p p+  -- |Return the pane with the specified ID, fail if there is none.+  Get :: PaneId -> Panes p p+  -- |Return the pane with the specified ID if it exists.+  Find :: PaneId -> Panes p (Maybe p)++type TmuxPanes p =+  TmuxApi (Panes p)++query ::+  ∀ p a .+  TmuxCodec p =>+  Panes p a ->+  TmuxQuery+query _ =+  Codec.query @p++selection :: Panes p a -> PaneSelection+selection = \case+  List ps -> ps+  First ps -> ps+  One ps -> ps+  Get i -> PaneSelection.InWindow (Target.Pane i)+  Find _ -> PaneSelection.All++request ::+  Panes p a ->+  TmuxQuery ->+  TmuxRequest+request (selection -> s) =+  TmuxRequest "list-panes" (cmdArgs s) . Just++encode ::+  ∀ p a .+  TmuxCodec p =>+  Panes p a ->+  TmuxRequest+encode (Get i) =+  request (Get i) (Codec.query @(WithPaneId p))+encode (Find i) =+  request (Find i) (Codec.query @(WithPaneId p))+encode cmd =+  request cmd (query cmd)++sameId :: PaneId -> WithPaneId a -> Maybe a+sameId target (WithPaneId paneId p)+  | target == paneId = Just p+  | otherwise = Nothing++paneById ::+  TmuxCodec p =>+  PaneId ->+  [Text] ->+  Either DecodeError (Maybe p)+paneById paneId out = do+  firstJust (sameId paneId) <$> multi out++decode ::+  ∀ p a .+  TmuxCodec p =>+  TmuxResponse ->+  Panes p a ->+  Either DecodeError a+decode (TmuxResponse out) = \case+  List _ ->+    multi out+  First _ ->+    multi out >>= \case+      [] -> Left (DecodeError out DecodeFailure.TooFewFields)+      a : _ -> Right a+  One _ ->+    single out+  Get paneId -> do+    ps <- multi @(WithPaneId p) out+    maybeToRight (DecodeError out DecodeFailure.TargetMissing) (firstJust (sameId paneId) ps)+  Find paneId -> do+    ps <- multi @(WithPaneId p) out+    pure (firstJust (sameId paneId) ps)
+ lib/Chiasma/Data/PipePaneParams.hs view
@@ -0,0 +1,38 @@+module Chiasma.Data.PipePaneParams where++import Prelude hiding (input, output)++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), arg, flag1)+import Chiasma.Data.Target (Target (Current))++data PipePaneParams =+  PipePaneParams {+    input :: Bool,+    output :: Bool,+    onlyNew :: Bool,+    target :: Target,+    command :: Maybe Text+  }+  deriving stock (Eq, Show)++instance Default PipePaneParams where+  def =+    PipePaneParams {+      input = False,+      output = False,+      onlyNew = False,+      target = Current,+      command = Nothing+    }++instance CmdArgs PipePaneParams where+  cmdArgs PipePaneParams {..} =+    flag1 "-I" input+    <>+    flag1 "-O" output+    <>+    flag1 "-o" onlyNew+    <>+    cmdArgs target+    <>+    arg command
+ lib/Chiasma/Data/ProcessError.hs view
@@ -0,0 +1,5 @@+module Chiasma.Data.ProcessError where++data ProcessError =+  Terminated Text+  deriving stock (Eq, Show)
+ lib/Chiasma/Data/ReceiveEvent.hs view
@@ -0,0 +1,6 @@+module Chiasma.Data.ReceiveEvent where++import Chiasma.Data.Event (Event)++data ReceiveEvent :: Type -> Type where+  ReceiveEvent :: ReceiveEvent Event
lib/Chiasma/Data/RenderError.hs view
@@ -1,6 +1,8 @@ module Chiasma.Data.RenderError where +import Chiasma.Data.CodecError (CodecError) import Chiasma.Data.Ident (Ident)+import Chiasma.Data.LayoutError (LayoutError) import Chiasma.Data.TmuxError (TmuxError) import Chiasma.Data.Views (ViewsError) @@ -9,9 +11,11 @@   |   Views ViewsError   |+  Layout LayoutError+  |   Pack Text   |   Fatal TmuxError-  deriving (Eq, Show)--deepPrisms ''RenderError+  |+  Codec CodecError+  deriving stock (Eq, Show)
+ lib/Chiasma/Data/ResizePaneParams.hs view
@@ -0,0 +1,58 @@+module Chiasma.Data.ResizePaneParams where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), arg, flag1, optionArgs)+import Chiasma.Data.Axis (Axis (Horizontal, Vertical))+import Chiasma.Data.Direction (Direction)+import Chiasma.Data.Target (Target (Current))++data ResizeAbsolute =+  ResizeAbsolute Axis Int+  deriving stock (Eq, Show)++instance CmdArgs ResizeAbsolute where+  cmdArgs (ResizeAbsolute axis amount) =+    [axisArg axis, show amount]+    where+      axisArg = \case+        Horizontal -> "-x"+        Vertical -> "-y"++data Adjustment =+  Adjustment (Maybe Direction) (Maybe Int)+  deriving stock (Eq, Show)++instance CmdArgs Adjustment where+  cmdArgs (Adjustment dir amount) =+    optionArgs dir <> arg (show <$> amount)++data ResizePaneParams =+  ResizePaneParams {+    absolute :: Maybe ResizeAbsolute,+    adjustment :: Maybe Adjustment,+    zoom :: Bool,+    mouse :: Bool,+    target :: Target+  }+  deriving stock (Eq, Show)++instance Default ResizePaneParams where+  def =+    ResizePaneParams {+      absolute = Nothing,+      adjustment = Nothing,+      zoom = False,+      mouse = False,+      target = Current+    }++instance CmdArgs ResizePaneParams where+  cmdArgs ResizePaneParams {..} =+    optionArgs absolute+    <>+    flag1 "-Z" zoom+    <>+    flag1 "-M" mouse+    <>+    optionArgs adjustment+    <>+    cmdArgs target
+ lib/Chiasma/Data/SelectParams.hs view
@@ -0,0 +1,65 @@+module Chiasma.Data.SelectParams where++import Prelude hiding (input, last)++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), flag1, option, optionArgs)+import Chiasma.Data.Direction (Direction)+import Chiasma.Data.Target (Target)++data SelectInput =+  EnableInput+  |+  DisableInput+  deriving stock (Eq, Show)++instance CmdArgs SelectInput where+  cmdArgs = \case+    EnableInput -> ["-e"]+    DisableInput -> ["-d"]++data SelectMark =+  SelectMark+  |+  SelectUnmark+  deriving stock (Eq, Show)++instance CmdArgs SelectMark where+  cmdArgs = \case+    SelectMark -> ["-m"]+    SelectUnmark -> ["-M"]++data SelectParams =+  SelectParams {+    neighbor :: Maybe Direction,+    last :: Bool,+    input :: Maybe SelectInput,+    mark :: Maybe SelectMark,+    title :: Maybe Text,+    target :: Target+  }+  deriving stock (Eq, Show)++instance Default SelectParams where+  def =+    SelectParams {+      neighbor = Nothing,+      last = False,+      input = Nothing,+      mark = Nothing,+      title = Nothing,+      target = def+    }++instance CmdArgs SelectParams where+  cmdArgs SelectParams {..} =+    optionArgs neighbor+    <>+    flag1 "-l" last+    <>+    optionArgs input+    <>+    optionArgs mark+    <>+    option "-T" title+    <>+    cmdArgs target
+ lib/Chiasma/Data/SelectWindowParams.hs view
@@ -0,0 +1,38 @@+module Chiasma.Data.SelectWindowParams where++import Prelude hiding (last)++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), flag1)+import Chiasma.Data.Target (Target)++data SelectWindowParams =+  SelectWindowParams {+    last :: Bool,+    next :: Bool,+    previous :: Bool,+    toggle :: Bool,+    target :: Target+  }+  deriving stock (Eq, Show)++instance Default SelectWindowParams where+  def =+    SelectWindowParams {+      last = False,+      next = False,+      previous = False,+      toggle = False,+      target = def+    }++instance CmdArgs SelectWindowParams where+  cmdArgs SelectWindowParams {..} =+    flag1 "-l" last+    <>+    flag1 "-n" next+    <>+    flag1 "-p" previous+    <>+    flag1 "-T" toggle+    <>+    cmdArgs target
+ lib/Chiasma/Data/SendKeysParams.hs view
@@ -0,0 +1,78 @@+module Chiasma.Data.SendKeysParams where++import qualified Data.Text as Text+import Exon (exon)+import Prelude hiding (repeat)++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), flag1, optionWith)+import Chiasma.Data.Target (Target)++escape :: Text -> Text+escape fragment =+  [exon|"#{escapeQuotes}"|]+  where+    escapeQuotes =+      Text.replace [exon|"|] [exon|\"|] fragment++data Key =+  Key Text+  |+  Lit Text+  deriving stock (Eq, Show)++instance IsString Key where+  fromString =+    Lit . toText++instance CmdArgs Key where+  cmdArgs = \case+    Key k -> [k]+    Lit s -> [escape s]++data SendKeysParams =+  SendKeysParams {+    enter :: Bool,+    literal :: Bool,+    hex :: Bool,+    reset :: Bool,+    mouse :: Bool,+    copyMode :: Bool,+    repeat :: Maybe Int,+    keys :: [Key],+    target :: Target+  }+  deriving stock (Eq, Show)++instance Default SendKeysParams where+  def =+    SendKeysParams {+      enter = True,+      literal = False,+      hex = False,+      reset = False,+      mouse = False,+      copyMode = False,+      repeat = Nothing,+      keys = mempty,+      target = def+    }++instance CmdArgs SendKeysParams where+  cmdArgs SendKeysParams {..} =+    flag1 "-l" literal+    <>+    flag1 "-H" hex+    <>+    flag1 "-R" reset+    <>+    flag1 "-M" mouse+    <>+    flag1 "-X" copyMode+    <>+    optionWith "-N" show repeat+    <>+    cmdArgs target+    <>+    (cmdArgs =<< keys)+    <>+    flag1 "enter" (enter && not copyMode)
+ lib/Chiasma/Data/SessionGroupId.hs view
@@ -0,0 +1,6 @@+module Chiasma.Data.SessionGroupId where++newtype SessionGroupId =+  SessionGroupId { unSessionGroupId :: Text }+  deriving stock (Eq, Show, Generic)+  deriving newtype (IsString)
+ lib/Chiasma/Data/SessionParams.hs view
@@ -0,0 +1,72 @@+module Chiasma.Data.SessionParams where++import Path (Abs, Dir, Path)++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), arg, envVars, flag1, identOption, optionWith)+import Chiasma.Data.Ident (Ident)+import Chiasma.Data.SessionGroupId (SessionGroupId (unSessionGroupId))+import Chiasma.Path (pathText)++data SessionParams =+  SessionParams {+    attach :: Bool,+    defaultSize :: Bool,+    detach :: Bool,+    exitClient :: Bool,+    printInfo :: Bool,+    cwd :: Maybe (Path Abs Dir),+    environment :: Map Text Text,+    name :: Maybe Ident,+    windowName :: Maybe Ident,+    target :: Maybe SessionGroupId,+    width :: Maybe Int,+    height :: Maybe Int,+    command :: Maybe Text+  }+  deriving stock (Eq, Show)++instance Default SessionParams where+  def =+    SessionParams {+      attach = False,+      defaultSize = False,+      detach = False,+      exitClient = False,+      printInfo = True,+      cwd = Nothing,+      environment = mempty,+      name = Nothing,+      windowName = Nothing,+      target = Nothing,+      width = Nothing,+      height = Nothing,+      command = Nothing+    }++instance CmdArgs SessionParams where+  cmdArgs SessionParams {..} =+    flag1 "-A" attach+    <>+    flag1 "-d" defaultSize+    <>+    flag1 "-D" detach+    <>+    envVars environment+    <>+    flag1 "-P" printInfo+    <>+    flag1 "-X" exitClient+    <>+    optionWith "-c" pathText cwd+    <>+    identOption "-n" windowName+    <>+    identOption "-s" name+    <>+    optionWith "-t" unSessionGroupId target+    <>+    optionWith "-x" show width+    <>+    optionWith "-y" show height+    <>+    arg command
+ lib/Chiasma/Data/SplitParams.hs view
@@ -0,0 +1,84 @@+module Chiasma.Data.SplitParams where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), flag1, optionArgs)+import Chiasma.Data.Axis (Axis)+import Chiasma.Data.Target (Target (Current), formatTarget)++data SplitSize =+  Units Int+  |+  Percentage Int+  deriving stock (Eq, Show)++instance CmdArgs SplitSize where+  cmdArgs = \case+    Units n -> ["-l", show n]+    Percentage n -> ["-p", show n]++data SplitWindowParams =+  SplitWindowParams {+    axis :: Maybe Axis,+    size :: Maybe SplitSize,+    before :: Bool,+    fullSize :: Bool,+    readStdin :: Bool+  }+  deriving stock (Eq, Show)++instance Default SplitWindowParams where+  def =+    SplitWindowParams {+      axis = Nothing,+      size = Nothing,+      before = False,+      fullSize = False,+      readStdin = False+    }++instance CmdArgs SplitWindowParams where+  cmdArgs SplitWindowParams {..} =+    optionArgs axis+    <>+    optionArgs size+    <>+    flag1 "-b" before+    <>+    flag1 "-f" fullSize+    <>+    flag1 "-K" readStdin++data JoinPaneParams =+  JoinPaneParams {+    axis :: Maybe Axis,+    size :: Maybe SplitSize,+    before :: Bool,+    detach :: Bool,+    source :: Maybe Target,+    target :: Target+  }+  deriving stock (Eq, Show)++instance Default JoinPaneParams where+  def =+    JoinPaneParams {+      axis = Nothing,+      size = Nothing,+      before = False,+      detach = False,+      source = Nothing,+      target = Current+    }++instance CmdArgs JoinPaneParams where+  cmdArgs JoinPaneParams {..} =+    optionArgs axis+    <>+    optionArgs size+    <>+    flag1 "-b" before+    <>+    flag1 "-d" detach+    <>+    foldMap (formatTarget ["-s"]) source+    <>+    cmdArgs target
+ lib/Chiasma/Data/Target.hs view
@@ -0,0 +1,32 @@+module Chiasma.Data.Target where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs))+import Chiasma.Data.TmuxId (PaneId, SessionId, WindowId, formatId)++data Target =+  Pane PaneId+  |+  Window WindowId+  |+  Session SessionId+  |+  Current+  deriving stock (Eq, Show)++formatTarget :: [Text] -> Target -> [Text]+formatTarget pre = \case+    Pane i -> pre <> [formatId i]+    Window i -> pre <> [formatId i]+    Session i -> pre <> [formatId i]+    Current -> []++instance CmdArgs Target where+  cmdArgs = \case+    Pane i -> ["-t", formatId i]+    Window i -> ["-t", formatId i]+    Session i -> ["-t", formatId i]+    Current -> []++instance Default Target where+  def =+    Current
+ lib/Chiasma/Data/TmuxCommand.hs view
@@ -0,0 +1,213 @@+module Chiasma.Data.TmuxCommand where++import Data.List (dropWhileEnd)+import qualified Data.Text as Text+import Exon (exon)+import Text.Show (Show (showsPrec), showParen, showString, shows)++import Chiasma.Class.CmdArgs (cmdArgs)+import qualified Chiasma.Codec as Codec+import Chiasma.Codec (multi, single)+import Chiasma.Codec.Data.Client (Client)+import Chiasma.Codec.Data.Pane (Pane)+import Chiasma.Codec.Data.Session (Session)+import Chiasma.Codec.Data.Window (Window)+import Chiasma.Data.CapturePaneParams (CapturePaneParams (CapturePaneParams), stripBlank, stripTrailingWs)+import Chiasma.Data.CopyModeParams (CopyModeParams)+import Chiasma.Data.DecodeError (DecodeError)+import Chiasma.Data.KillPaneParams (KillPaneParams)+import Chiasma.Data.PaneSelection (PaneSelection)+import Chiasma.Data.PipePaneParams (PipePaneParams)+import Chiasma.Data.ResizePaneParams (ResizePaneParams)+import Chiasma.Data.SelectParams (SelectParams)+import Chiasma.Data.SelectWindowParams (SelectWindowParams)+import Chiasma.Data.SendKeysParams (SendKeysParams)+import Chiasma.Data.SessionParams (SessionParams)+import Chiasma.Data.SplitParams (JoinPaneParams, SplitWindowParams)+import Chiasma.Data.Target (Target)+import Chiasma.Data.TmuxId (ClientId (ClientId))+import Chiasma.Data.TmuxQuery (TmuxQuery)+import Chiasma.Data.TmuxRequest (TmuxRequest (TmuxRequest))+import Chiasma.Data.TmuxResponse (TmuxResponse (TmuxResponse))+import Chiasma.Data.WindowParams (WindowParams)+import Chiasma.Data.WindowSelection (WindowSelection)+import Chiasma.Function (applyWhen)++data TmuxCommand :: Type -> Type where+  Fmap :: (a -> b) -> TmuxCommand a -> TmuxCommand b+  ListPanes :: PaneSelection -> TmuxCommand [Pane]+  ListWindows :: WindowSelection -> TmuxCommand [Window]+  ListSessions :: TmuxCommand [Session]+  ListClients :: TmuxCommand [Client]+  SwitchClient :: ClientId -> Target -> TmuxCommand ()+  NewWindow :: WindowParams -> TmuxCommand Window+  SplitWindow :: WindowParams -> SplitWindowParams -> TmuxCommand Pane+  SelectWindow :: SelectWindowParams -> TmuxCommand ()+  NewSession :: SessionParams -> TmuxCommand Session+  CopyMode :: CopyModeParams -> TmuxCommand ()+  SendKeys :: SendKeysParams -> TmuxCommand ()+  SelectPane :: SelectParams -> TmuxCommand ()+  KillPane :: KillPaneParams -> TmuxCommand ()+  MovePane :: JoinPaneParams -> TmuxCommand ()+  ResizePane :: ResizePaneParams -> TmuxCommand ()+  PipePane :: PipePaneParams -> TmuxCommand ()+  CapturePane :: CapturePaneParams -> TmuxCommand [Text]+  KillServer :: TmuxCommand ()++instance Functor TmuxCommand where+  fmap = Fmap++instance Show (TmuxCommand a) where+  showsPrec d = \case+    Fmap _ cmd ->+      showParen (d > 10) [exon|Fmap #{showsPrec 11 cmd}|]+    ListPanes sel ->+      showParen (d > 10) [exon|ListPanes #{showsPrec 11 sel}|]+    ListWindows sel ->+      showParen (d > 10) [exon|ListWindows #{showsPrec 11 sel}|]+    ListClients ->+      showString "ListClients"+    ListSessions ->+      showString "ListSessions"+    SwitchClient c t ->+      showParen (d > 10) [exon|SwitchClient #{showsPrec 11 c} #{showsPrec 11 t}|]+    NewWindow params ->+      showParen (d > 10) [exon|NewWindow #{showsPrec 11 params}|]+    SplitWindow wParams sParams ->+      showParen (d > 10) [exon|SplitWindow #{showsPrec 11 wParams} #{showsPrec 11 sParams}|]+    SelectWindow params ->+      showParen (d > 10) [exon|SelectWindow #{showsPrec 11 params}|]+    NewSession params ->+      showParen (d > 10) [exon|NewSession #{showsPrec 11 params}|]+    CopyMode params ->+      showParen (d > 10) [exon|SelectPane #{showsPrec 11 params}|]+    SendKeys params ->+      showParen (d > 10) [exon|SendKeys #{showsPrec 11 params}|]+    SelectPane paneId ->+      showParen (d > 10) [exon|SelectPane #{shows paneId}|]+    KillPane params ->+      showParen (d > 10) [exon|KillPane #{showsPrec 11 params}|]+    MovePane params ->+      showParen (d > 10) [exon|MovePane #{showsPrec 11 params}|]+    ResizePane params ->+      showParen (d > 10) [exon|ResizePane #{showsPrec 11 params}|]+    PipePane params ->+      showParen (d > 10) [exon|PipePane #{showsPrec 11 params}|]+    CapturePane params ->+      showParen (d > 10) [exon|CapturePane #{showsPrec 11 params}|]+    KillServer ->+      showString "KillServer"++query ::+  ∀ a .+  TmuxCommand a ->+  Maybe TmuxQuery+query = \case+  Fmap _ cmd -> query cmd+  ListPanes _ -> Just (Codec.query @Pane)+  ListWindows _ -> Just (Codec.query @Window)+  ListSessions -> Just (Codec.query @Session)+  ListClients -> Just (Codec.query @Client)+  SwitchClient _ _ -> Nothing+  NewWindow _ -> Just (Codec.query @Window)+  SplitWindow _ _ -> Just (Codec.query @Pane)+  SelectWindow _ -> Nothing+  NewSession _ -> Just (Codec.query @Session)+  CopyMode _ -> Nothing+  SendKeys _ -> Nothing+  SelectPane _ -> Nothing+  KillPane _ -> Nothing+  MovePane _ -> Nothing+  ResizePane _ -> Nothing+  PipePane _ -> Nothing+  CapturePane _ -> Nothing+  KillServer -> Nothing++request :: TmuxCommand a -> Maybe TmuxQuery -> TmuxRequest+request = \case+  Fmap _ c ->+    request c+  ListPanes selection ->+    TmuxRequest "list-panes" (cmdArgs selection)+  ListWindows selection ->+    TmuxRequest "list-windows" (cmdArgs selection)+  ListSessions ->+    TmuxRequest "list-sessions" []+  ListClients ->+    TmuxRequest "list-clients" []+  SwitchClient (ClientId client) target ->+    TmuxRequest "switch-client" (["-c", client] <> cmdArgs target)+  NewWindow params ->+    TmuxRequest "new-window" (cmdArgs params)+  SplitWindow wParams sParams ->+    TmuxRequest "split-window" (cmdArgs wParams <> cmdArgs sParams)+  SelectWindow params ->+    TmuxRequest "select-window" (cmdArgs params)+  NewSession params ->+    TmuxRequest "new-session" (cmdArgs params)+  CopyMode params ->+    TmuxRequest "copy-mode" (cmdArgs params)+  SendKeys params ->+    TmuxRequest "send-keys" (cmdArgs params)+  SelectPane params ->+    TmuxRequest "select-pane" (cmdArgs params)+  KillPane params ->+    TmuxRequest "kill-pane" (cmdArgs params)+  MovePane params ->+    TmuxRequest "move-pane" (cmdArgs params)+  ResizePane params ->+    TmuxRequest "resize-pane" (cmdArgs params)+  PipePane params ->+    TmuxRequest "pipe-pane" (cmdArgs params)+  CapturePane params ->+    TmuxRequest "capture-pane" (cmdArgs params)+  KillServer ->+    TmuxRequest "kill-server" []++encode :: TmuxCommand a -> TmuxRequest+encode cmd =+  request cmd (query cmd)++decode :: TmuxResponse -> TmuxCommand a -> Either DecodeError a+decode (TmuxResponse out) = \case+  Fmap f cmd ->+    f <$> decode (TmuxResponse out) cmd+  ListPanes _ ->+    multi out+  ListWindows _ ->+    multi out+  ListSessions ->+    multi out+  ListClients ->+    multi out+  SwitchClient _ _ ->+    unit+  NewWindow _ ->+    single out+  SplitWindow _ _ ->+    single out+  SelectWindow _ ->+    unit+  NewSession _ ->+    single out+  CopyMode _ ->+    unit+  SendKeys _ ->+    unit+  SelectPane _ ->+    unit+  KillPane _ ->+    unit+  MovePane _ ->+    unit+  ResizePane _ ->+    unit+  PipePane _ ->+    unit+  CapturePane CapturePaneParams {stripBlank, stripTrailingWs} ->+    pure $+    applyWhen stripBlank (dropWhileEnd ("" ==)) $+    applyWhen stripTrailingWs (fmap Text.stripEnd) $+    out+  KillServer ->+    unit
lib/Chiasma/Data/TmuxError.hs view
@@ -1,39 +1,23 @@ module Chiasma.Data.TmuxError where -import Chiasma.Codec.Decode (TmuxDecodeError)-import Text.ParserCombinators.Parsec (ParseError)+import Polysemy.Process.Data.ProcessError (ProcessError) -import Chiasma.Data.Cmd (Cmds(..))+import Chiasma.Data.CodecError (CodecError (CodecError))+import Chiasma.Data.DecodeError (DecodeError)+import Chiasma.Data.TmuxRequest (TmuxRequest)  data TmuxError =-  ProcessFailed {-    processFailedCmds :: Cmds,-    processFailedReason :: Text-    }-  |-  OutputParsingFailed {-    parsingFailedCmds :: Cmds,-    parsingFailedOutput :: [Text],-    parsingFailedError :: ParseError-  }+  ProcessFailed ProcessError   |-  NoOutput Cmds+  RequestFailed TmuxRequest [Text]   |-  DecodingFailed {-    decodingFailedCmds :: Cmds,-    decodingFailedOutput :: Text,-    decodingFailedError :: TmuxDecodeError-  }+  DecodeFailed TmuxRequest DecodeError   |-  InvalidOutput {-    invalidOutputReason :: Text,-    invalidOutputCommand :: Text-  }+  NoClients   |-  CommandFailed {-    commandFailedCmds :: Cmds,-    commandFailedError :: [Text]-  }-  deriving (Eq, Show)+  NoExe+  deriving stock (Eq, Show) -deepPrisms ''TmuxError+codec :: CodecError -> TmuxError+codec (CodecError req err) =+  DecodeFailed req err
lib/Chiasma/Data/TmuxId.hs view
@@ -1,35 +1,43 @@ module Chiasma.Data.TmuxId where -import Data.Text.Prettyprint.Doc (Pretty(..))+import Prettyprinter (Pretty (..)) -sessionPrefix :: Char-sessionPrefix = '$'+newtype ClientId =+  ClientId { unClientId :: Text }+  deriving stock (Eq, Show, Generic)+  deriving newtype (IsString) +instance Pretty ClientId where+  pretty = pretty . unClientId++sessionPrefix :: Text+sessionPrefix = "$"+ newtype SessionId =   SessionId Int-  deriving (Eq, Show, Generic)+  deriving stock (Eq, Show, Generic)   deriving newtype (Num, Ord)  instance Pretty SessionId where   pretty = pretty . formatId -windowPrefix :: Char-windowPrefix = '@'+windowPrefix :: Text+windowPrefix = "@"  newtype WindowId =   WindowId Int-  deriving (Eq, Show, Generic)+  deriving stock (Eq, Show, Generic)   deriving newtype (Num, Ord)  instance Pretty WindowId where   pretty = pretty . formatId -panePrefix :: Char-panePrefix = '%'+panePrefix :: Text+panePrefix = "%"  newtype PaneId =   PaneId Int-  deriving (Eq, Show, Generic)+  deriving stock (Eq, Show, Generic)   deriving newtype (Num, Ord)  instance Pretty PaneId where@@ -39,7 +47,9 @@   paneId :: a -> PaneId  newtype TmuxIdPrefix a =-  TmuxIdPrefix Char+  TmuxIdPrefix { unTmuxIdPrefix :: Text }+  deriving stock (Eq, Show, Generic)+  deriving newtype (IsString)  class TmuxId a where   prefix :: TmuxIdPrefix a@@ -47,7 +57,7 @@    formatId :: a -> Text   formatId a =-    toText (p : show (number a))+    p <> show (number a)     where       (TmuxIdPrefix p) = prefix @a 
+ lib/Chiasma/Data/TmuxNative.hs view
@@ -0,0 +1,10 @@+module Chiasma.Data.TmuxNative where++import Path (Abs, File, Path)++data TmuxNative =+  TmuxNative {+    executable :: Path Abs File,+    tmuxServerSocket :: Maybe (Path Abs File)+  }+  deriving stock (Eq, Show)
+ lib/Chiasma/Data/TmuxOutputBlock.hs view
@@ -0,0 +1,13 @@+module Chiasma.Data.TmuxOutputBlock where++data End =+  EndSuccess+  |+  EndError+  deriving stock (Eq, Show)++data TmuxOutputBlock =+  Success [Text]+  |+  Error [Text]+  deriving stock (Eq, Show)
+ lib/Chiasma/Data/TmuxQuery.hs view
@@ -0,0 +1,6 @@+module Chiasma.Data.TmuxQuery where++newtype TmuxQuery =+  TmuxQuery { unTmuxQuery :: Text }+  deriving stock (Eq, Show, Generic)+  deriving newtype (IsString, Semigroup, Monoid)
+ lib/Chiasma/Data/TmuxRequest.hs view
@@ -0,0 +1,24 @@+module Chiasma.Data.TmuxRequest where++import qualified Data.Text as Text+import Chiasma.Data.TmuxQuery (TmuxQuery (TmuxQuery))++data TmuxRequest =+  TmuxRequest {+    cmd :: Text,+    args :: [Text],+    query :: Maybe TmuxQuery+  }+  deriving stock (Eq, Show)++queryArgs :: TmuxQuery -> [Text]+queryArgs (TmuxQuery q) =+  ["-F", "'", q, "'"]++cmdline :: TmuxRequest -> [Text]+cmdline TmuxRequest { ..} =+  cmd : args ++ foldMap queryArgs query ++ ["\n"]++encode :: TmuxRequest -> ByteString+encode req =+  encodeUtf8 (Text.unwords (cmdline req))
+ lib/Chiasma/Data/TmuxResponse.hs view
@@ -0,0 +1,6 @@+module Chiasma.Data.TmuxResponse where++newtype TmuxResponse =+  TmuxResponse { unTmuxResponse :: [Text] }+  deriving stock (Eq, Show)+  deriving newtype (Semigroup, Monoid)
lib/Chiasma/Data/TmuxThunk.hs view
@@ -1,16 +1,16 @@ module Chiasma.Data.TmuxThunk where -import Chiasma.Codec.Decode (TmuxDecodeError)-import Chiasma.Data.Cmd (Cmd(..))-import Chiasma.Data.TmuxError (TmuxError(..))+-- import Chiasma.Codec.Decode (DecodeFailure)+-- import Chiasma.Data.Cmd (Cmd(..))+-- import Chiasma.Data.TmuxError (TmuxError(..)) -data TmuxThunk next =-  ∀ a . Read Cmd (Text -> Either TmuxDecodeError a) ([a] -> next)-  |-  Write Cmd (() -> next)-  |-  Flush (() -> next)-  |-  Failed TmuxError+-- data TmuxThunk next =+--   ∀ a . Read Cmd (Text -> Either DecodeFailure a) ([a] -> next)+--   |+--   Write Cmd (() -> next)+--   |+--   Flush (() -> next)+--   |+--   Failed TmuxError -deriving instance Functor TmuxThunk+-- deriving instance Functor TmuxThunk
lib/Chiasma/Data/View.hs view
@@ -9,7 +9,7 @@     viewIdent :: Ident,     viewId :: Maybe a   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  makeClassy_ ''View 
lib/Chiasma/Data/Views.hs view
@@ -1,9 +1,8 @@-{-# LANGUAGE DeriveAnyClass #-}- module Chiasma.Data.Views where -import Data.Text.Prettyprint.Doc (Doc)-import Data.Text.Prettyprint.Doc.Render.Terminal (AnsiStyle)+import Control.Lens (makeClassy)+import Prettyprinter (Doc)+import Prettyprinter.Render.Terminal (AnsiStyle)  import Chiasma.Data.Ident (Ident) import Chiasma.Data.TmuxId (PaneId, SessionId, WindowId)@@ -17,9 +16,7 @@   NoSuchPane Ident   |   NoPaneId Ident-  deriving (Eq, Show)--deepPrisms ''ViewsError+  deriving stock (Eq, Show)  data Views =   Views {@@ -28,10 +25,11 @@     _panes :: [View PaneId],     _log :: [Doc AnsiStyle]   }-  deriving (Show, Generic, Default)+  deriving stock (Show, Generic)+  deriving anyclass (Default) +makeClassy ''Views+ instance Eq Views where   (Views sa wa pa _) == (Views sb wb pb _) =     (sa == sb) && (wa == wb) && (pa == pb)--deepLenses ''Views
+ lib/Chiasma/Data/WindowParams.hs view
@@ -0,0 +1,56 @@+module Chiasma.Data.WindowParams where++import Path (Abs, Dir, Path)++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs), arg, envVars, flag1, identOption, optionWith)+import Chiasma.Data.Ident (Ident)+import Chiasma.Data.Target (Target)+import Chiasma.Path (pathText')++data WindowParams =+  WindowParams {+    after :: Bool,+    detach :: Bool,+    killExisting :: Bool,+    printInfo :: Bool,+    cwd :: Maybe (Path Abs Dir),+    environment :: Map Text Text,+    name :: Maybe Ident,+    target :: Target,+    command :: Maybe Text+  }+  deriving stock (Eq, Show)++instance Default WindowParams where+  def =+    WindowParams {+      after = False,+      detach = False,+      killExisting = False,+      printInfo = True,+      cwd = Nothing,+      environment = mempty,+      name = Nothing,+      target = def,+      command = Nothing+    }++instance CmdArgs WindowParams where+  cmdArgs WindowParams {..} =+    flag1 "-a" after+    <>+    flag1 "-d" detach+    <>+    flag1 "-k" killExisting+    <>+    flag1 "-P" printInfo+    <>+    optionWith "-c" pathText' cwd+    <>+    envVars environment+    <>+    identOption "-n" name+    <>+    cmdArgs target+    <>+    arg command
+ lib/Chiasma/Data/WindowSelection.hs view
@@ -0,0 +1,19 @@+module Chiasma.Data.WindowSelection where++import Chiasma.Class.CmdArgs (CmdArgs (cmdArgs))+import Chiasma.Data.Target (Target (Current))++data WindowSelection =+  All+  |+  InSession Target+  deriving stock (Eq, Show)++instance CmdArgs WindowSelection where+  cmdArgs = \case+    All -> ["-a"]+    InSession target -> cmdArgs target++instance Default WindowSelection where+  def =+    InSession Current
lib/Chiasma/Data/WindowState.hs view
@@ -15,4 +15,4 @@     wsLayout :: RenderableTree,     wsReferencePane :: PaneId   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)
+ lib/Chiasma/Data/WithPaneId.hs view
@@ -0,0 +1,39 @@+module Chiasma.Data.WithPaneId where++import qualified Data.Text as Text++import Chiasma.Codec (TmuxCodec (decode, query), trim)+import Chiasma.Codec.Decode (primDecode)+import Chiasma.Data.DecodeError (DecodeError (DecodeError), DecodeFailure (TooFewFields))+import qualified Chiasma.Data.TmuxId as TmuxId+import Chiasma.Data.TmuxId (HasPaneId, PaneId)+import Chiasma.Data.TmuxQuery (TmuxQuery (TmuxQuery))++data WithPaneId a =+  WithPaneId {+    paneId :: PaneId,+    pane :: a+  }+  deriving stock (Eq, Show, Generic)++instance HasPaneId (WithPaneId a) where+  paneId = paneId++safeBreakOn :: Text -> Text -> Maybe (Text, Text)+safeBreakOn n = \case+  "" -> Nothing+  t -> Just (second (Text.drop 1) (Text.breakOn n t))++instance TmuxCodec a => TmuxCodec (WithPaneId a) where+  decode payload =+    case safeBreakOn " " (trim payload) of+      Just (idField, rest) -> do+        pane <- decode rest+        paneId <- first (DecodeError [payload]) (primDecode idField)+        pure WithPaneId {..}+      Nothing ->+        Left (DecodeError [payload] TooFewFields)++  query =+    let TmuxQuery paneQuery = query @a+    in TmuxQuery ("#{pane_id} " <> paneQuery)
+ lib/Chiasma/Effect/Codec.hs view
@@ -0,0 +1,32 @@+module Chiasma.Effect.Codec where++import Chiasma.Data.CodecError (CodecError)+import Chiasma.Data.TmuxCommand (TmuxCommand)+import Chiasma.Data.TmuxRequest (TmuxRequest)+import Chiasma.Data.TmuxResponse (TmuxResponse)++data Codec (command :: Type -> Type) (i :: Type) (o :: Type) :: Effect where+  WithCodec :: command a -> (i -> m o) -> Codec command i o m a+  Encode :: command a -> Codec command i o m i++makeSem ''Codec++type NativeCodec command =+  Codec command TmuxRequest TmuxResponse++type NativeCodecE command =+  NativeCodec command !! CodecError++type NativeCommandCodec =+  NativeCodec TmuxCommand++type NativeCommandCodecE =+  NativeCodecE TmuxCommand++type family NativeCodecs (cs :: [Type -> Type]) :: [Effect] where+  NativeCodecs '[] = '[]+  NativeCodecs (c : cs) = NativeCodec c : NativeCodecs cs++type family NativeCodecsE (cs :: [Type -> Type]) :: [Effect] where+  NativeCodecsE '[] = '[]+  NativeCodecsE (c : cs) = NativeCodecE c : NativeCodecsE cs
+ lib/Chiasma/Effect/TmuxApi.hs view
@@ -0,0 +1,12 @@+module Chiasma.Effect.TmuxApi where++import Chiasma.Data.TmuxCommand (TmuxCommand)++data TmuxApi (command :: Type -> Type) :: Effect where+  Send :: command a -> TmuxApi command m a+  Schedule :: command a -> TmuxApi command m ()++makeSem ''TmuxApi++type Tmux =+  TmuxApi TmuxCommand
+ lib/Chiasma/Effect/TmuxClient.hs view
@@ -0,0 +1,28 @@+module Chiasma.Effect.TmuxClient where++import Prelude hiding (send)++import Chiasma.Data.TmuxRequest (TmuxRequest)+import Chiasma.Data.TmuxResponse (TmuxResponse)++data TmuxClient (i :: Type) (o :: Type) :: Effect where+  Send :: i -> TmuxClient i o m o+  Schedule :: i -> TmuxClient i o m ()++makeSem ''TmuxClient++type ScopedTmux i o =+  Scoped_ (TmuxClient i o)++type NativeTmux =+  ScopedTmux TmuxRequest TmuxResponse++flush ::+  Member (TmuxClient e d) r =>+  InterpreterFor (TmuxClient e d) r+flush =+  interpret \case+    Send cmd ->+      send cmd+    Schedule cmd ->+      void (send cmd)
+ lib/Chiasma/Event.hs view
@@ -0,0 +1,58 @@+module Chiasma.Event where++import Exon (exon)+import qualified Polysemy.Conc as Conc+import Polysemy.Conc (withAsync_)+import qualified Polysemy.Log as Log+import qualified Polysemy.Time as Time+import Polysemy.Time (Seconds (Seconds))+import Prelude hiding (listen)++import Chiasma.Data.Event (Event)+import Chiasma.Data.ReceiveEvent (ReceiveEvent (ReceiveEvent))+import Chiasma.Data.TmuxError (TmuxError)+import Chiasma.Effect.Codec (Codec)+import qualified Chiasma.Effect.TmuxApi as TmuxApi+import Chiasma.Effect.TmuxApi (TmuxApi)+import Chiasma.Effect.TmuxClient (TmuxClient)+import Chiasma.Tmux (withTmux)++receiveEvent ::+  ∀ r .+  Members [TmuxApi ReceiveEvent, Events Event] r =>+  Sem r ()+receiveEvent =+  Conc.publish =<< TmuxApi.send ReceiveEvent++listenLoop ::+  ∀ err t d r .+  Show err =>+  Members [TmuxApi ReceiveEvent !! err, Events Event, Time t d, Log] r =>+  Sem r ()+listenLoop = do+  resume @_ @(TmuxApi _) receiveEvent \ err ->+    Log.error [exon|Receiving tmux event: #{show err}|]+  listenLoop++listen ::+  ∀ enc dec err t d r .+  Show err =>+  Member (Codec ReceiveEvent enc dec !! err) r =>+  Members [Scoped_ (TmuxClient enc dec) !! TmuxError, Events Event, Time t d, Log] r =>+  Sem r ()+listen = do+  resume @_ @(Scoped_ _) (withTmux listenLoop) \ err -> do+    Log.error [exon|Lost connection to tmux: #{show err}+Reconnecting...|]+    Time.sleep (Seconds 1)++withTmuxEvents ::+  Show err =>+  Member (Codec ReceiveEvent enc dec !! err) r =>+  Member (Scoped_ (TmuxClient enc dec) !! TmuxError) r =>+  Members [Events Event, Time t d, Log, Race, Async, Resource] r =>+  Sem r a ->+  Sem r a+withTmuxEvents =+  withAsync_ do+    forever listen
+ lib/Chiasma/Function.hs view
@@ -0,0 +1,7 @@+module Chiasma.Function where++applyWhen :: Bool -> (a -> a) -> a -> a+applyWhen True f x =+  f x+applyWhen False _ x =+  x
+ lib/Chiasma/Interpreter/Codec.hs view
@@ -0,0 +1,50 @@+module Chiasma.Interpreter.Codec where++import Chiasma.Codec (TmuxCodec)+import Chiasma.Data.CodecError (CodecError (CodecError))+import Chiasma.Data.DecodeError (DecodeError)+import qualified Chiasma.Data.Panes as Panes+import Chiasma.Data.Panes (Panes)+import qualified Chiasma.Data.TmuxCommand as TmuxCommand+import Chiasma.Data.TmuxCommand (TmuxCommand)+import Chiasma.Data.TmuxRequest (TmuxRequest)+import Chiasma.Data.TmuxResponse (TmuxResponse)+import qualified Chiasma.Effect.Codec as Codec+import Chiasma.Effect.Codec (Codec)++interpretCodecNative ::+  (∀ x . cmd x -> TmuxRequest) ->+  (∀ x . TmuxResponse -> cmd x -> Either DecodeError x) ->+  InterpreterFor (Codec cmd TmuxRequest TmuxResponse !! CodecError) r+interpretCodecNative enc dec =+  interpretResumableH \case+    Codec.Encode cmd ->+      pureT (enc cmd)+    Codec.WithCodec cmd use -> do+      let req = enc cmd+      out <- runTSimple (use req)+      Inspector ins <- getInspectorT+      pureT =<< stopEitherWith (CodecError req) (dec (fold (ins out)) cmd)++interpretCodecTmuxCommand ::+  InterpreterFor (Codec TmuxCommand TmuxRequest TmuxResponse !! CodecError) r+interpretCodecTmuxCommand =+  interpretCodecNative TmuxCommand.encode TmuxCommand.decode+{-# inline interpretCodecTmuxCommand #-}++interpretCodecPanes ::+  TmuxCodec p =>+  InterpreterFor (Codec (Panes p) TmuxRequest TmuxResponse !! CodecError) r+interpretCodecPanes =+  interpretCodecNative Panes.encode Panes.decode+{-# inline interpretCodecPanes #-}++interpretCodecPure ::+  (∀ a . command a -> Sem r (Either Text a)) ->+  InterpreterFor (Codec command () decode !! Text) r+interpretCodecPure run =+  interpretResumableH \case+    Codec.Encode _ ->+      pureT ()+    Codec.WithCodec cmd _ ->+      either stop pureT =<< raise (raise (run cmd))
+ lib/Chiasma/Interpreter/ProcessOutput.hs view
@@ -0,0 +1,39 @@+module Chiasma.Interpreter.ProcessOutput where++import Data.Attoparsec.ByteString (parse)+import Data.Attoparsec.Types (IResult (Done, Fail, Partial))+import Polysemy.Conc (interpretAtomic)+import Polysemy.Process.Effect.ProcessOutput (ProcessOutput (Chunk))++import Chiasma.Data.TmuxOutputBlock (TmuxOutputBlock)+import Chiasma.Native.TmuxOutputBlock (parser)++type ParseResult =+  IResult ByteString TmuxOutputBlock++type ParseCont =+  ByteString -> IResult ByteString TmuxOutputBlock++parseResult ::+  Member (AtomicState (Maybe ParseCont)) r =>+  ParseResult ->+  Sem r ([Either Text TmuxOutputBlock], ByteString)+parseResult = \case+  Fail _ _ err -> pure ([Left (toText err)], "")+  Partial c -> ([], "") <$ atomicPut (Just c)+  Done rest block -> pure ([Right block], rest)++interpretProcessOutputTmuxBlock ::+  ∀ p r .+  Member (Embed IO) r =>+  InterpreterFor (ProcessOutput p (Either Text TmuxOutputBlock)) r+interpretProcessOutputTmuxBlock =+  interpretAtomic (Nothing :: Maybe ParseCont) .+  interpret \case+    Chunk _ new ->+      atomicState' (Nothing,) >>= \case+        Just cont ->+          parseResult (cont new)+        Nothing ->+          parseResult (parse parser new)+  . raiseUnder
+ lib/Chiasma/Interpreter/Pure.hs view
@@ -0,0 +1,13 @@+module Chiasma.Interpreter.Pure where++import Chiasma.Data.TmuxError (TmuxError)+import Chiasma.Effect.Codec (Codec)+import Chiasma.Effect.TmuxClient (TmuxClient)+import Chiasma.Interpreter.Codec (interpretCodecPure)+import Chiasma.Interpreter.TmuxClient (interpretTmuxClientNull)++interpretTmuxPure ::+  (∀ a . command a -> Sem r (Either Text a)) ->+  InterpretersFor [Scoped_ (TmuxClient () ()) !! TmuxError, Codec command () () !! Text] r+interpretTmuxPure run =+  interpretCodecPure run . interpretTmuxClientNull
+ lib/Chiasma/Interpreter/TmuxApi.hs view
@@ -0,0 +1,90 @@+module Chiasma.Interpreter.TmuxApi where++import Fcf (Eval, Exp, Pure1, type (@@))+import Fcf.Class.Functor (FMap)+import Prelude hiding (send, type (@@))++import Chiasma.Data.CodecError (CodecError)+import Chiasma.Data.TmuxRequest (TmuxRequest)+import Chiasma.Data.TmuxResponse (TmuxResponse)+import Chiasma.Effect.Codec (Codec, encode, withCodec)+import Chiasma.Effect.TmuxApi (TmuxApi (Schedule, Send), send)+import qualified Chiasma.Effect.TmuxClient as TmuxClient+import Chiasma.Effect.TmuxClient (TmuxClient)++type family (f :: l -> k) <$> (fa :: [l]) :: [k] where+  f <$> fa =+    FMap (Pure1 f) @@ fa++flush ::+  Member (TmuxApi c) r =>+  InterpreterFor (TmuxApi c) r+flush =+  interpret \case+    Send cmd ->+      send cmd+    Schedule cmd ->+      void (send cmd)++interpretTmuxApi ::+  ∀ command i o err r .+  Members [TmuxClient i o, Codec command i o !! err] r =>+  InterpreterFor (TmuxApi command !! err) r+interpretTmuxApi =+  interpretResumable \case+    Send cmd -> do+      restop @_ @(Codec _ _ _) $ withCodec cmd \ encoded -> do+        TmuxClient.send encoded+    Schedule cmd -> do+      encoded <- restop (encode cmd)+      TmuxClient.schedule encoded++data TmuxApiEffect :: Type -> (Type -> Type) -> Exp Effect++type instance Eval (TmuxApiEffect err command) =+  TmuxApi command !! err++type family TmuxApis (commands :: [Type -> Type]) (err :: Type) :: EffectRow where+  TmuxApis commands err =+    FMap (TmuxApiEffect err) @@ commands++class InterpretApis (commands :: [Type -> Type]) err i o r where+  interpretApis :: InterpretersFor (TmuxApis commands err) (TmuxClient i o : r)++instance InterpretApis '[] err i o r where+  interpretApis =+    id++instance (+    r1 ~ (TmuxApis commands err ++ TmuxClient i o : r),+    Member (TmuxClient i o) r1,+    Member (Codec command i o !! err) r1,+    InterpretApis commands err i o r+  ) => InterpretApis (command : commands) err i o r where+    interpretApis =+      interpretApis @commands @err . interpretTmuxApi++type InterpretApisNative commands r =+  InterpretApis commands CodecError TmuxRequest TmuxResponse r++class RestopApis (commands :: [Type -> Type]) err i o r where+  restopApis :: InterpretersFor (TmuxApi <$> commands) (TmuxClient i o : r)++instance RestopApis '[] err i o r where+  restopApis =+    id++instance (+    r1 ~ (TmuxApi <$> commands ++ TmuxClient i o : r),+    Members [TmuxClient i o, Stop err] r1,+    Member (Codec command i o !! err) r1,+    RestopApis commands err i o r+  ) => RestopApis (command : commands) err i o r where+    restopApis =+      restopApis @commands @err @i @o .+      interpretTmuxApi @command @i @o .+      restop @err @(TmuxApi command) .+      raiseUnder++type RestopApisNative commands r =+  RestopApis commands CodecError TmuxRequest TmuxResponse r
+ lib/Chiasma/Interpreter/TmuxClient.hs view
@@ -0,0 +1,201 @@+module Chiasma.Interpreter.TmuxClient where++import Conc (interpretAtomic, interpretScopedResumableWith_, interpretScopedResumable_)+import Data.Sequence ((|>))+import qualified Data.Text as Text+import Exon (exon)+import qualified Log as Log+import Path (Abs, File, Path, relfile, toFilePath)+import Polysemy.Process.Interpreter.Process (ProcessQueues)+import qualified Process as Process+import Process (+  OutputPipe (Stderr, Stdout),+  Process,+  ProcessError,+  SystemProcess,+  SystemProcessError,+  SystemProcessScopeError,+  interpretProcessInputId,+  interpretProcessOutputLeft,+  interpretProcessOutputTextLines,+  interpretProcess_,+  interpretSystemProcessNative_,+  resolveExecutable,+  withProcess_,+  )+import System.Process.Typed (ProcessConfig, proc)++import qualified Chiasma.Data.TmuxError as TmuxError+import Chiasma.Data.TmuxError (TmuxError (NoExe))+import Chiasma.Data.TmuxNative (TmuxNative (TmuxNative))+import qualified Chiasma.Data.TmuxOutputBlock as TmuxOutputBlock+import Chiasma.Data.TmuxOutputBlock (TmuxOutputBlock)+import qualified Chiasma.Data.TmuxRequest as TmuxRequest+import Chiasma.Data.TmuxRequest (TmuxRequest (TmuxRequest))+import Chiasma.Data.TmuxResponse (TmuxResponse (TmuxResponse))+import qualified Chiasma.Effect.TmuxClient as TmuxClient+import Chiasma.Effect.TmuxClient (TmuxClient)+import Chiasma.Interpreter.ProcessOutput (interpretProcessOutputTmuxBlock)++type TmuxQueues =+  ProcessQueues (Either Text TmuxOutputBlock) Text++type TmuxProc =+  Process ByteString (Either Text TmuxOutputBlock)++validate :: TmuxRequest -> TmuxOutputBlock -> Either TmuxError TmuxResponse+validate request = \case+  TmuxOutputBlock.Success a ->+    Right (TmuxResponse a)+  TmuxOutputBlock.Error a ->+    Left (TmuxError.RequestFailed request a)++tmuxRequest ::+  Members [Process ByteString (Either Text TmuxOutputBlock), Log, Stop TmuxError] r =>+  TmuxRequest ->+  Sem r TmuxResponse+tmuxRequest request = do+  Log.trace [exon|tmux request: #{Text.stripEnd (decodeUtf8 cmdline)}|]+  Process.send cmdline+  Process.recv >>= \case+    Left err -> stop (TmuxError.RequestFailed request [err])+    Right block -> do+      Log.trace [exon|tmux response: #{show block}|]+      stopEither (validate request block)+  where+    cmdline =+      TmuxRequest.encode request++socketArg :: Path Abs File -> [String]+socketArg socket =+  ["-S", toFilePath socket]++tmuxProc ::+  TmuxNative ->+  ProcessConfig () () ()+tmuxProc (TmuxNative exe socket) =+  proc (toFilePath exe) (foldMap socketArg socket <> ["-C", "-u", "attach-session", "-f", "ignore-size"])++interpretSystemProcessTmux ::+  Members [Reader TmuxNative, Resource, Race, Async, Embed IO] r =>+  InterpreterFor (Scoped_ (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r+interpretSystemProcessTmux sem = do+  conf <- tmuxProc <$> ask+  interpretSystemProcessNative_ conf sem++interpretProcessTmux ::+  Member (Scoped_ (SystemProcess !! SystemProcessError) !! SystemProcessScopeError) r =>+  Members [Resource, Race, Async, Embed IO] r =>+  InterpreterFor (Scoped_ TmuxProc !! ProcessError) r+interpretProcessTmux sem = do+  interpretProcessOutputTmuxBlock @'Stdout $+    interpretProcessOutputTextLines @'Stderr $+    interpretProcessOutputLeft @'Stderr $+    interpretProcessInputId $+    interpretProcess_ def $+    insertAt @1 sem+{-# inline interpretProcessTmux #-}++flush ::+  Members [TmuxProc, AtomicState (Seq TmuxRequest), Log, Stop TmuxError] r =>+  Sem r ()+flush =+  traverse_ tmuxRequest =<< atomicState' (mempty,)++tmuxSession ::+  ∀ r a .+  Members [Scoped_ TmuxProc !! ProcessError, AtomicState (Seq TmuxRequest), Log, Stop TmuxError] r =>+  Sem (TmuxProc : r) a ->+  Sem r a+tmuxSession action =+  resumeHoist @ProcessError @(Scoped_ TmuxProc) TmuxError.ProcessFailed $ withProcess_ do+    void Process.recv+    tmuxRequest (TmuxRequest "refresh-client" ["-C", "10000x10000"] Nothing)+    raiseUnder action <* flush++interpretTmuxProcessBuffered ::+  Members [AtomicState (Seq TmuxRequest), Scoped_ TmuxProc !! ProcessError, Log, Embed IO] r =>+  InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r+interpretTmuxProcessBuffered =+  interpretScopedResumableWith_ @'[TmuxProc] (const tmuxSession) \case+    TmuxClient.Schedule request ->+      atomicModify' (|> request)+    TmuxClient.Send cmd -> do+      flush+      tmuxRequest cmd+{-# inline interpretTmuxProcessBuffered #-}++interpretTmuxWithProcess ::+  Members [Scoped_ TmuxProc !! ProcessError, Log, Embed IO] r =>+  InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r+interpretTmuxWithProcess =+  interpretAtomic mempty .+  interpretTmuxProcessBuffered .+  raiseUnder+{-# inline interpretTmuxWithProcess #-}++interpretTmuxNative ::+  ∀ r .+  Members [Reader TmuxNative, Log, Resource, Race, Async, Embed IO] r =>+  InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r+interpretTmuxNative =+  interpretSystemProcessTmux .+  interpretProcessTmux .+  interpretTmuxWithProcess .+  raiseUnder2+{-# inline interpretTmuxNative #-}++interpretTmuxFailing ::+  TmuxError ->+  InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r+interpretTmuxFailing err =+  interpretScopedResumable_ mempty \ () -> \case+    TmuxClient.Schedule _ ->+      stop err+    TmuxClient.Send _ ->+      stop err++withTmuxNativeEnv ::+  Member (Embed IO) r =>+  Maybe (Path Abs File) ->+  (Maybe TmuxNative -> Sem r a) ->+  Sem r a+withTmuxNativeEnv socket use =+  use . fmap (flip TmuxNative socket) . rightToMaybe =<< resolveExecutable [relfile|tmux|] Nothing++runReaderTmuxNativeEnv ::+  Members [Error TmuxError, Embed IO] r =>+  Maybe (Path Abs File) ->+  InterpreterFor (Reader TmuxNative) r+runReaderTmuxNativeEnv socket sem = do+  tn <- withTmuxNativeEnv socket (note NoExe)+  runReader tn sem+{-# inline runReaderTmuxNativeEnv #-}++interpretTmuxNativeEnv ::+  Members [Error TmuxError, Log, Resource, Race, Async, Embed IO] r =>+  Maybe (Path Abs File) ->+  InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r+interpretTmuxNativeEnv socket =+  runReaderTmuxNativeEnv socket . interpretTmuxNative . raiseUnder+{-# inline interpretTmuxNativeEnv #-}++interpretTmuxNativeEnvGraceful ::+  Members [Log, Resource, Race, Async, Embed IO] r =>+  Maybe (Path Abs File) ->+  InterpreterFor (Scoped_ (TmuxClient TmuxRequest TmuxResponse) !! TmuxError) r+interpretTmuxNativeEnvGraceful socket sem =+  withTmuxNativeEnv socket \case+    Just tn -> runReader tn (interpretTmuxNative (raiseUnder sem))+    Nothing -> interpretTmuxFailing NoExe sem+{-# inline interpretTmuxNativeEnvGraceful #-}++interpretTmuxClientNull ::+  InterpreterFor (Scoped_ (TmuxClient i ()) !! TmuxError) r+interpretTmuxClientNull =+  interpretScopedResumable_ mempty \ () -> \case+    TmuxClient.Schedule _ ->+      unit+    TmuxClient.Send _ ->+      unit+{-# inline interpretTmuxClientNull #-}
lib/Chiasma/Lens/Tree.hs view
@@ -1,37 +1,36 @@-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE RankNTypes #-}-{-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE DeriveDataTypeable #-}- module Chiasma.Lens.Tree where -import Chiasma.Data.Ident (Ident, Identifiable(..))-import Chiasma.Ui.Data.View-import Chiasma.Ui.Lens.Ident (matchIdentP) import Control.Lens (   Fold,   Index,   IxValue,-  Ixed(ix),-  Plated(..),-  Traversal',+  Ixed (ix),+  Plated (..),   cosmos,-  each,   makeClassy_,-  over,   preview,-  toListOf,   transform,   ) import Data.Data (Data) import Data.Foldable (foldrM)+import Prelude hiding (ix, transform) +import Chiasma.Data.Ident (Ident, Identifiable (..))+import Chiasma.Ui.Data.View (+  HasTree (_treeSubs),+  HasTreeSub (leafData),+  LayoutView,+  PaneView,+  Tree (Tree),+  TreeSub (TreeNode),+  )+import Chiasma.Ui.Lens.Ident (matchIdentP)+ newtype NodeIndexTree l p =   NodeIndexTree {     nitTree :: Tree l p   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  makeClassy_ ''NodeIndexTree @@ -39,7 +38,7 @@   LeafIndexTree {     litTree :: Tree l p   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  makeClassy_ ''LeafIndexTree @@ -90,7 +89,7 @@ subtreesWithLayout :: ∀ l p m. Monad m => ((l, TreeSub l p) -> m (l, TreeSub l p)) -> Tree l p -> m (Tree l p) subtreesWithLayout f (Tree l0 sub) = do   (newL, newSub) <- foldrM applySub (l0, []) sub-  return (Tree newL newSub)+  pure (Tree newL newSub)   where     prependSub s (newL, newN) = (newL, newN : s)     applySub :: TreeSub l p -> (l, [TreeSub l p]) -> m (l, [TreeSub l p])@@ -103,7 +102,7 @@ subtrees :: ∀ l p m. Monad m => (TreeSub l p -> m (TreeSub l p)) -> Tree l p -> m (Tree l p) subtrees f (Tree l sub) = do   newSub <- mapM applySub sub-  return (Tree l newSub)+  pure (Tree l newSub)   where     applySub :: TreeSub l p -> m (TreeSub l p)     applySub (TreeNode t) = do
lib/Chiasma/Lens/Where.hs view
@@ -1,10 +1,6 @@-{-# LANGUAGE RankNTypes #-}--module Chiasma.Lens.Where(-  where1,-) where+module Chiasma.Lens.Where where -import Control.Lens (Over, filtered, taking)+import Control.Lens (Over, taking)  where1 :: (Applicative f, Traversable t) => (a -> Bool) -> Over (->) f (t a) (t a) a a where1 predicate = taking 1 $ traverse . filtered predicate
lib/Chiasma/Monad/EvalFreeT.hs view
@@ -1,50 +1,50 @@ module Chiasma.Monad.EvalFreeT where -import Control.Monad.Trans.Free (FreeF(..), FreeT(..))+-- import Control.Monad.Trans.Free (FreeF(..), FreeT(..)) -import Chiasma.Codec.Decode (TmuxDecodeError)-import Chiasma.Data.Cmd (Cmd(..), Cmds(..))-import Chiasma.Data.TmuxError (TmuxError)-import Chiasma.Data.TmuxThunk (TmuxThunk(..))+-- import Chiasma.Codec.Decode (DecodeFailure)+-- import Chiasma.Data.Cmd (Cmd(..), Cmds(..))+-- import Chiasma.Data.TmuxError (TmuxError)+-- import Chiasma.Data.TmuxThunk (TmuxThunk(..)) -newtype CmdBuffer = CmdBuffer [Cmd]+-- newtype CmdBuffer = CmdBuffer [Cmd] -instance Default CmdBuffer where-  def = CmdBuffer def+-- instance Default CmdBuffer where+--   def = CmdBuffer def -type CommandExec m =-  (∀ b. (Text -> Either TmuxDecodeError b) -> Cmds -> m (Either TmuxError [b]))+-- type CommandExec m =+--   (∀ b. (Text -> Either DecodeFailure b) -> Cmds -> m (Either TmuxError [b])) -evalFreeF ::-  Monad m =>-  CommandExec m ->-  CmdBuffer ->-  FreeF TmuxThunk a (FreeT TmuxThunk m a) ->-  m (Either TmuxError a)-evalFreeF _ (CmdBuffer []) (Pure a) =-  return (Right a)-evalFreeF exec (CmdBuffer cmds) (Pure a) =-  Right a <$ exec (const $ Right ()) (Cmds cmds)-evalFreeF exec (CmdBuffer cmds) (Free (Read cmd decode next)) = do-  a <- exec decode $ Cmds (cmd : cmds)-  case a of-    Right a' -> evalFreeT exec def (next a')-    Left err -> return (Left err)-evalFreeF exec (CmdBuffer cmds) (Free (Write cmd next)) =-  evalFreeT exec (CmdBuffer (cmd : cmds)) (next ())-evalFreeF exec (CmdBuffer cmds) (Free (Flush next)) =-  exec (const $ Right ()) (Cmds cmds) >>= \case-    Right _ -> evalFreeT exec def (next ())-    Left err -> return (Left err)-evalFreeF _ _ (Free (Failed err)) =-  return (Left err)+-- evalFreeF ::+--   Monad m =>+--   CommandExec m ->+--   CmdBuffer ->+--   FreeF TmuxThunk a (FreeT TmuxThunk m a) ->+--   m (Either TmuxError a)+-- evalFreeF _ (CmdBuffer []) (Pure a) =+--   pure (Right a)+-- evalFreeF exec (CmdBuffer cmds) (Pure a) =+--   Right a <$ exec (const $ Right ()) (Cmds cmds)+-- evalFreeF exec (CmdBuffer cmds) (Free (Read cmd decode next)) = do+--   a <- exec decode $ Cmds (cmd : cmds)+--   case a of+--     Right a' -> evalFreeT exec def (next a')+--     Left err -> pure (Left err)+-- evalFreeF exec (CmdBuffer cmds) (Free (Write cmd next)) =+--   evalFreeT exec (CmdBuffer (cmd : cmds)) (next ())+-- evalFreeF exec (CmdBuffer cmds) (Free (Flush next)) =+--   exec (const $ Right ()) (Cmds cmds) >>= \case+--     Right _ -> evalFreeT exec def (next ())+--     Left err -> pure (Left err)+-- evalFreeF _ _ (Free (Failed err)) =+--   pure (Left err) -evalFreeT ::-  Monad m =>-  CommandExec m ->-  CmdBuffer ->-  FreeT TmuxThunk m a ->-  m (Either TmuxError a)-evalFreeT exec s (FreeT ma) = do-  inner <- ma-  evalFreeF exec s inner+-- evalFreeT ::+--   Monad m =>+--   CommandExec m ->+--   CmdBuffer ->+--   FreeT TmuxThunk m a ->+--   m (Either TmuxError a)+-- evalFreeT exec s (FreeT ma) = do+--   inner <- ma+--   evalFreeF exec s inner
− lib/Chiasma/Monad/IndividualProcess.hs
@@ -1,40 +0,0 @@-module Chiasma.Monad.IndividualProcess where--import Control.Monad.Free (Free(..))--import Chiasma.Api.Class (TmuxApi(..))-import Chiasma.Data.Cmd (Cmd(..), Cmds(..))-import Chiasma.Data.TmuxError (TmuxError)-import Chiasma.Data.TmuxThunk (TmuxThunk(..))--type TmuxProg = Free TmuxThunk--newtype TmuxState = TmuxState [Cmd]--instance Default TmuxState where-  def = TmuxState def--interpret ::-  (TmuxApi m api, MonadDeepError e TmuxError m) =>-  TmuxState ->-  api ->-  TmuxProg a ->-  m a-interpret (TmuxState cmds) api (Pure a) = a <$ runCommands api (const $ Right ()) (Cmds cmds)-interpret (TmuxState cmds) api (Free (Read cmd decode next)) = do-  a <- runCommands api decode $ Cmds (cmd : cmds)-  interpret def api (next a)-interpret (TmuxState cmds) api (Free (Write cmd next)) =-  interpret (TmuxState (cmd : cmds)) api (next ())-interpret (TmuxState cmds) api (Free (Flush next)) = do-  _ <- runCommands api (const $ Right ()) (Cmds cmds)-  interpret def api (next ())-interpret _ _ (Free (Failed err)) =-  throwHoist err--runTmux ::-  (TmuxApi m api, MonadDeepError e TmuxError m) =>-  api ->-  TmuxProg a ->-  m a-runTmux = interpret def
− lib/Chiasma/Monad/Stream.hs
@@ -1,80 +0,0 @@-module Chiasma.Monad.Stream where--import Conduit (ConduitT, Flush(..), runConduit, sinkList, yield, yieldMany, (.|))-import Control.Monad.Trans.Free (FreeT(..))-import qualified Data.Conduit.Combinators as Conduit (drop, take)--import Chiasma.Api.Class (TmuxApi(..))-import Chiasma.Codec.Decode (TmuxDecodeError)-import Chiasma.Data.Cmd (Cmd(..), Cmds(..))-import Chiasma.Data.TmuxError (TmuxError)-import qualified Chiasma.Data.TmuxError as TmuxError (TmuxError(ProcessFailed, DecodingFailed, CommandFailed))-import Chiasma.Data.TmuxThunk (TmuxThunk)-import Chiasma.Monad.EvalFreeT (evalFreeT)-import Chiasma.Native.StreamParse (TmuxOutputBlock)-import qualified Chiasma.Native.StreamParse as TmuxOutputBlock (TmuxOutputBlock(..))--type TmuxProg = FreeT TmuxThunk--type WriteCmd m =-  ConduitT (Flush Cmd) Void m ()--type ReadOutput m =-  ConduitT () TmuxOutputBlock m ()--handleProcessOutput ::-  Cmds ->-  (Text -> Either TmuxDecodeError a) ->-  [TmuxOutputBlock] ->-  Either TmuxError [a]-handleProcessOutput cs@(Cmds cmds) _ output | length output < length cmds =-  Left $ TmuxError.ProcessFailed cs "tmux terminated before all commands were processed"-handleProcessOutput cmds decode output = do-  readOutput <- foldl validate (Right []) output-  traverse decode' readOutput-  where-    validate (Left err) _ = Left err-    validate _ (TmuxOutputBlock.Success a) = Right a-    validate _ (TmuxOutputBlock.Error a) = Left $ TmuxError.CommandFailed cmds a-    decode' outputLine =-      mapLeft (TmuxError.DecodingFailed cmds outputLine) . decode $ outputLine--executeCommands ::-  MonadIO m =>-  WriteCmd m ->-  ReadOutput m ->-  (Text -> Either TmuxDecodeError a) ->-  Cmds ->-  m (Either TmuxError [a])-executeCommands writeCmd readOutput decode cs@(Cmds cmds) = do-  output <- runConduit $ do-    yieldMany (Chunk <$> reverse cmds) .| writeCmd-    yield Flush .| writeCmd-    readOutput .| Conduit.take (length cmds) .| sinkList-  return $ handleProcessOutput cs decode output--runTmuxProg ::-  MonadIO m =>-  TmuxProg m a ->-  WriteCmd m ->-  ReadOutput m ->-  m (Either TmuxError a)-runTmuxProg prog writeCmd readOutput = do-  runConduit $ readOutput .| Conduit.drop 1-  evalFreeT (executeCommands writeCmd readOutput) def prog--runTmuxE ::-  (MonadIO m, TmuxApi m api) =>-  api ->-  TmuxProg m a ->-  m (Either TmuxError a)-runTmuxE api prog =-  withTmux api (runTmuxProg prog)--runTmux ::-  (MonadIO m, MonadDeepError e TmuxError m, TmuxApi m api) =>-  api ->-  TmuxProg m a ->-  m a-runTmux api =-  hoistEither <=< runTmuxE api
lib/Chiasma/Monad/Tmux.hs view
@@ -1,49 +1,49 @@ module Chiasma.Monad.Tmux where -import Control.Monad.Free (liftF)-import Control.Monad.Free.Class (MonadFree)+-- import Control.Monad.Free (liftF)+-- import Control.Monad.Free.Class (MonadFree) -import Chiasma.Codec (TmuxCodec, TmuxQuery(unQ))-import qualified Chiasma.Codec as TmuxCodec (TmuxCodec(decode, query))-import Chiasma.Data.Cmd (cmd)-import Chiasma.Data.TmuxError (TmuxError(InvalidOutput))-import Chiasma.Data.TmuxThunk (TmuxThunk(..))+-- import Chiasma.Codec (TmuxCodec, TmuxQuery(unQ))+-- import qualified Chiasma.Codec as TmuxCodec (TmuxCodec(decode, query))+-- import Chiasma.Data.Cmd (cmd)+-- import Chiasma.Data.TmuxError (TmuxError(InvalidOutput))+-- import Chiasma.Data.TmuxThunk (TmuxThunk(..)) -read :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m [a]-read name args =-  liftF $ Read (cmd name (args <> formatArgs)) TmuxCodec.decode id-  where-    formatArgs = ["-F", "'", unQ (TmuxCodec.query @a), "'"]+-- read :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m [a]+-- read name args =+--   liftF $ Read (cmd name (args <> formatArgs)) TmuxCodec.decode id+--   where+--     formatArgs = ["-F", "'", unQ (TmuxCodec.query @a), "'"] -unsafeReadOne :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m a-unsafeReadOne name args = do-  outputs <- read name args-  case outputs of-    [a] -> return a-    [] -> liftF $ Failed $ InvalidOutput "no data" (name <> unwords args)-    _ -> liftF $ Failed $ InvalidOutput "multiple outputs for `unsafeReadOne`" (name <> unwords args)+-- unsafeReadOne :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m a+-- unsafeReadOne name args = do+--   outputs <- read name args+--   case outputs of+--     [a] -> pure a+--     [] -> liftF $ Failed $ InvalidOutput "no data" (name <> unwords args)+--     _ -> liftF $ Failed $ InvalidOutput "multiple outputs for `unsafeReadOne`" (name <> unwords args) -readFirst :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m (Maybe a)-readFirst name args = do-  outputs <- read name args-  return $ case outputs of-    (a : _) -> Just a-    [] -> Nothing+-- readFirst :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m (Maybe a)+-- readFirst name args = do+--   outputs <- read name args+--   pure $ case outputs of+--     (a : _) -> Just a+--     [] -> Nothing -unsafeReadFirst :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m a-unsafeReadFirst name args = do-  mayFirst <- readFirst name args-  case mayFirst of-    (Just a) -> return a-    Nothing -> liftF $ Failed $ InvalidOutput "no data" (name <> unwords args)+-- unsafeReadFirst :: ∀ a m . (TmuxCodec a, MonadFree TmuxThunk m) => Text -> [Text] -> m a+-- unsafeReadFirst name args = do+--   mayFirst <- readFirst name args+--   case mayFirst of+--     (Just a) -> pure a+--     Nothing -> liftF $ Failed $ InvalidOutput "no data" (name <> unwords args) -readRaw :: ∀ m . (MonadFree TmuxThunk m) => Text -> [Text] -> m [Text]-readRaw name args =-  liftF $ Read (cmd name args) Right id+-- readRaw :: ∀ m . (MonadFree TmuxThunk m) => Text -> [Text] -> m [Text]+-- readRaw name args =+--   liftF $ Read (cmd name args) Right id -write :: MonadFree TmuxThunk m => Text -> [Text] -> m ()-write name args = liftF $ Write (cmd name args) id+-- write :: MonadFree TmuxThunk m => Text -> [Text] -> m ()+-- write name args = liftF $ Write (cmd name args) id -flush :: MonadFree TmuxThunk m => m ()-flush =-  liftF $ Flush id+-- flush :: MonadFree TmuxThunk m => m ()+-- flush =+--   liftF $ Flush id
− lib/Chiasma/Native/Api.hs
@@ -1,67 +0,0 @@-{-# LANGUAGE UndecidableInstances #-}--module Chiasma.Native.Api where--import Chiasma.Data.TmuxError (TmuxError)-import Conduit (ConduitT, Flush, mapC, (.|))-import Control.Monad.Catch (MonadMask)-import qualified Control.Monad.Catch as Catch (bracket)-import Data.Conduit.Process.Typed (createSource)-import qualified Data.Text as Text (unwords)-import System.Process.Typed (-  Process,-  ProcessConfig,-  getStdin,-  getStdout,-  proc,-  setStdin,-  setStdout,-  startProcess,-  stopProcess,-  )-import Text.ParserCombinators.Parsec ()--import Chiasma.Api.Class (TmuxApi(..))-import Chiasma.Data.Cmd (Cmd(..), CmdArgs(..), CmdName(..))-import Chiasma.Data.Conduit (createSinkFlush)-import Chiasma.Native.Process (nativeTmuxProcess, socketArg)-import Chiasma.Native.StreamParse (parseConduit)--newtype TmuxNative =-  TmuxNative { tmuxServerSocket :: Maybe FilePath }-  deriving Show--formatCmd :: Cmd -> ByteString-formatCmd (Cmd (CmdName name) (CmdArgs args)) =-  encodeUtf8 . Text.unwords $ name : args ++ ["\n"]--tmuxProcessConfig ::-  MonadIO m =>-  Maybe FilePath ->-  ProcessConfig (ConduitT (Flush ByteString) Void m ()) (ConduitT () ByteString m ()) ()-tmuxProcessConfig sock =-  cons args-  where-    cons =-      setStdin createSinkFlush . setStdout createSource . proc "tmux"-    args =-      toString <$> (socketArg sock ++ ["-C", "attach"])--withProcess :: (MonadIO m, MonadMask m)-            => ProcessConfig stdin stdout stderr-            -> (Process stdin stdout stderr -> m a)-            -> m a-withProcess config = Catch.bracket (startProcess config) stopProcess--instance (MonadIO m, MonadDeepError e TmuxError m, MonadMask m) => TmuxApi m TmuxNative where-  runCommands (TmuxNative socket) =-    nativeTmuxProcess socket--  withTmux (TmuxNative socket) f =-    withProcess (tmuxProcessConfig socket) handler-    where-      handler prc =-        let-          stdin' = mapC (fmap formatCmd) .| getStdin prc-          stdout' = getStdout prc .| parseConduit-        in f stdin' stdout'
lib/Chiasma/Native/Parse.hs view
@@ -1,7 +1,7 @@ module Chiasma.Native.Parse where  import qualified Data.Text as T (pack)-import Prelude hiding (many)+import Prelude hiding (many, try) import Text.Parsec (   ParseError,   many,
− lib/Chiasma/Native/Process.hs
@@ -1,57 +0,0 @@-module Chiasma.Native.Process where--import qualified Data.ByteString.Lazy as Lazy (ByteString)-import Data.ByteString.Lazy.Internal (unpackChars)-import qualified Data.Text as Text (intercalate, lines, pack, unwords)-import System.Exit (ExitCode(ExitSuccess))-import System.Process.Typed (ProcessConfig, byteStringInput, proc, readProcessStdout, setStdin)--import Chiasma.Codec.Decode (TmuxDecodeError)-import Chiasma.Data.Cmd (Cmd(..), CmdArgs(..), CmdName(..), Cmds(..))-import Chiasma.Data.TmuxError (TmuxError)-import qualified Chiasma.Data.TmuxError as TmuxError (-  TmuxError(OutputParsingFailed, NoOutput, ProcessFailed, DecodingFailed),-  )-import Chiasma.Native.Parse (resultLines)--cmdBytes :: [Text] -> Lazy.ByteString-cmdBytes cmds = encodeUtf8 $ Text.intercalate "\n" $ reverse $ "" : cmds--socketArg :: Maybe FilePath -> [Text]-socketArg (Just socket) = ["-S", toText socket]-socketArg Nothing = []--tmuxProcessConfig :: Maybe FilePath -> [Text] -> ProcessConfig () () ()-tmuxProcessConfig socket cmds =-  cons args-  where-  cons =-    setStdin (byteStringInput $ cmdBytes cmds) . proc "tmux"-  args =-    toString <$> (socketArg socket <> ["-C", "attach"])--handleProcessOutput :: Cmds -> ExitCode -> (Text -> Either TmuxDecodeError a) -> Text -> Either TmuxError [a]-handleProcessOutput cmds ExitSuccess decode out = do-  outputs <- mapLeft (TmuxError.OutputParsingFailed cmds (Text.lines out)) $ resultLines out-  case reverse outputs of-    output : _ -> traverse decode' output-    _ -> Left $ TmuxError.NoOutput cmds-  where-    decode' = mapLeft (TmuxError.DecodingFailed cmds out) . decode-handleProcessOutput cmds _ _ out =-  Left $ TmuxError.ProcessFailed cmds out--formatCmd :: Cmd -> Text-formatCmd (Cmd (CmdName name) (CmdArgs args)) =-  Text.unwords $ name : args--nativeTmuxProcess ::-  (MonadIO m, MonadDeepError e TmuxError m) =>-  Maybe FilePath ->-  (Text -> Either TmuxDecodeError a) ->-  Cmds ->-  m [a]-nativeTmuxProcess socket decode cmds@(Cmds cmds') = do-  let cmdLines = fmap formatCmd cmds'-  (code, out) <- readProcessStdout $ tmuxProcessConfig socket cmdLines-  hoistEither $ handleProcessOutput cmds code decode $ Text.pack $ unpackChars out
− lib/Chiasma/Native/StreamParse.hs
@@ -1,65 +0,0 @@-module Chiasma.Native.StreamParse(-  parseConduit,-  parseBlocks,-  TmuxOutputBlock(..),-) where--import Conduit (ConduitT, mapC, (.|))-import Control.Monad.Catch (MonadThrow)-import Data.Attoparsec.ByteString (Parser)-import Data.Conduit.Attoparsec (conduitParser)-import qualified Data.Text as T (pack)-import Text.Parser.Char (CharParsing, anyChar, newline, string)-import Text.Parser.Combinators (choice, manyTill, notFollowedBy, skipMany, try)-import Text.Parser.LookAhead (LookAheadParsing, lookAhead)--data End =-  EndSuccess-  |-  EndError-  deriving (Eq, Show)--data TmuxOutputBlock =-  Success [Text]-  |-  Error [Text]-  deriving (Eq, Show)--tillEol :: (Alternative m, CharParsing m) => m Text-tillEol = T.pack <$> manyTill anyChar newline--beginLine :: (Alternative m, CharParsing m, Monad m) => m ()-beginLine = void $ string "%begin" >> tillEol--endLine :: (Alternative m, CharParsing m) => m End-endLine = do-  end <- choice [EndSuccess <$ string "%end", EndError <$ string "%error"]-  _ <- tillEol-  return end--notBeginLine :: (Alternative m, CharParsing m, Monad m) => m ()-notBeginLine = void $ notFollowedBy (string "%begin") >> tillEol---- |Parse a sequence of lines between a %start and a %end line.--- Tmux pads output lines with a single space on both sides, so strip those if the leading one is present.-parseBlock :: (Alternative m, CharParsing m, Monad m, LookAheadParsing m) => m TmuxOutputBlock-parseBlock = do-  _ <- skipMany notBeginLine-  _ <- beginLine-  dataLines <- manyTill tillEol $ try $ lookAhead endLine-  end <- endLine-  return $ case end of-    EndSuccess -> Success dataLines-    EndError -> Error dataLines--parseBlocks :: (Alternative m, CharParsing m, Monad m, LookAheadParsing m) => m [TmuxOutputBlock]-parseBlocks = do-  result <- many (try parseBlock)-  skipMany tillEol-  return result--parser :: Parser TmuxOutputBlock-parser = parseBlock--parseConduit :: MonadThrow m => ConduitT ByteString TmuxOutputBlock m ()-parseConduit = conduitParser parser .| mapC snd
+ lib/Chiasma/Native/TmuxOutputBlock.hs view
@@ -0,0 +1,46 @@+module Chiasma.Native.TmuxOutputBlock where++import Data.Attoparsec.ByteString (Parser)+import Data.ByteString.Internal (packChars)+import Prelude hiding (try)+import Text.Parser.Char (CharParsing, anyChar, newline, string)+import Text.Parser.Combinators (choice, manyTill, notFollowedBy, skipMany, try)+import Text.Parser.LookAhead (LookAheadParsing, lookAhead)++import Chiasma.Data.TmuxOutputBlock (End (EndError, EndSuccess), TmuxOutputBlock (Error, Success))++tillEol :: (Alternative m, CharParsing m) => m Text+tillEol = decodeUtf8 . packChars <$> manyTill anyChar newline++beginLine :: (Alternative m, CharParsing m, Monad m) => m ()+beginLine = void $ string "%begin" >> tillEol++endLine :: (Alternative m, CharParsing m) => m End+endLine = do+  end <- choice [EndSuccess <$ string "%end", EndError <$ string "%error"]+  _ <- tillEol+  pure end++notBeginLine :: (Alternative m, CharParsing m, Monad m) => m ()+notBeginLine = void $ notFollowedBy (string "%begin") >> tillEol++-- |Parse a sequence of lines between a %start and a %end line.+-- Tmux pads output lines with a single space on both sides, so strip those if the leading one is present.+parseBlock :: (Alternative m, CharParsing m, Monad m, LookAheadParsing m) => m TmuxOutputBlock+parseBlock = do+  _ <- skipMany notBeginLine+  _ <- beginLine+  dataLines <- manyTill tillEol $ try (lookAhead endLine)+  end <- endLine+  pure $ case end of+    EndSuccess -> Success dataLines+    EndError -> Error dataLines++parseBlocks :: (Alternative m, CharParsing m, Monad m, LookAheadParsing m) => m [TmuxOutputBlock]+parseBlocks = do+  result <- many (try parseBlock)+  skipMany tillEol+  pure result++parser :: Parser TmuxOutputBlock+parser = parseBlock
lib/Chiasma/Pack.hs view
@@ -1,61 +1,64 @@ module Chiasma.Pack where -import qualified Chiasma.Codec.Data as Codec (Window(Window))+import Control.Lens (mapMOf_)+import qualified Data.List.NonEmpty as NonEmpty (reverse, toList)+import qualified Data.Set as Set (fromList, size)+import Prettyprinter (Doc, line, pretty, (<+>))++import qualified Chiasma.Codec.Data.Window as Codec (Window (Window)) import Chiasma.Command.Pane (movePane, resizePane)+import Chiasma.Data.Axis (Axis (Horizontal, Vertical)) import Chiasma.Data.TmuxId (PaneId)-import Chiasma.Data.TmuxThunk (TmuxThunk) import Chiasma.Data.Views (Views)-import Chiasma.Data.WindowState (WindowState(..))-import Chiasma.Ui.Data.Measure (MLayout(..), MPane(..), MeasureTree, MeasureTreeSub, Measured(Measured))-import Chiasma.Ui.Data.Tree (Node(Sub, Leaf), Tree(Tree))+import Chiasma.Data.WindowState (WindowState (..))+import Chiasma.Effect.TmuxApi (Tmux)+import Chiasma.Ui.Data.Measure (MLayout (..), MPane (..), MeasureTree, MeasureTreeSub, Measured (Measured))+import Chiasma.Ui.Data.Tree (Node (Leaf, Sub), Tree (Tree)) import qualified Chiasma.Ui.Data.Tree as Tree (subTree) import Chiasma.Ui.Measure (measureTree) import Chiasma.View (viewsLog)-import Control.Lens (each, mapMOf_)-import Control.Monad.Free.Class (MonadFree)-import qualified Data.List.NonEmpty as NonEmpty (reverse, toList)-import qualified Data.Set as Set (fromList, size)-import Data.Text.Prettyprint.Doc (Doc, line, pretty, (<+>))  packPane ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>+  Members [AtomicState Views, Tmux] r =>   PaneId ->-  Bool ->+  Axis ->   PaneId ->-  m ()-packPane refId vertical paneId =-  when (paneId /= refId) $ movePane paneId refId vertical+  Sem r ()+packPane refId axis paneId =+  when (paneId /= refId) do+    movePane paneId refId axis  positionView ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>-  Bool ->+  Members [AtomicState Views, Tmux] r =>+  Axis ->   PaneId ->   MeasureTreeSub ->-  m ()-positionView vertical refId =+  Sem r ()+positionView axis refId =   position   where     position (Sub (Tree (Measured _ (MLayout layoutRef _ _ _)) _)) =-      packPane refId vertical layoutRef+      packPane refId axis layoutRef     position (Leaf (Measured _ (MPane paneId _ _))) =-      packPane refId vertical paneId+      packPane refId axis paneId -describeVertical :: Bool -> Doc a-describeVertical True = "vertically"-describeVertical False = "horizontally"+describeAxis :: Axis -> Doc a+describeAxis = \case+  Vertical -> "vertically"+  Horizontal -> "horizontally"  resizeView ::-  MonadDeepState s Views m =>-  MonadFree TmuxThunk m =>-  Bool ->+  Members [AtomicState Views, Tmux] r =>+  Axis ->   MeasureTreeSub ->-  m ()-resizeView vertical (Sub (Tree (Measured size (MLayout refId _ _ _)) _)) = do-  viewsLog $ "resizing layout with ref" <+> pretty refId <+> "to" <+> pretty size <+> describeVertical vertical-  resizePane refId vertical size-resizeView vertical (Leaf (Measured size (MPane paneId _ _))) = do-  viewsLog $ "resizing pane" <+> pretty paneId <+> "to" <+> pretty size <+> describeVertical vertical-  resizePane paneId vertical size+  Sem r ()+resizeView axis = \case+  Sub (Tree (Measured size (MLayout refId _ _ _)) _) -> do+    viewsLog ("resizing layout with ref" <+> pretty refId <+> "to" <+> pretty size <+> describeAxis axis)+    resizePane refId axis size+  Leaf (Measured size (MPane paneId _ _)) -> do+    viewsLog $ "resizing pane" <+> pretty paneId <+> "to" <+> pretty size <+> describeAxis axis+    resizePane paneId axis size  needPositioning ::   NonEmpty MeasureTreeSub ->@@ -83,26 +86,26 @@       offPos  packTree ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>+  Members [AtomicState Views, Tmux] r =>   MeasureTree ->-  m ()+  Sem r () packTree =   pack   where-    pack (Tree (Measured _ (MLayout ref _ _ vertical)) sub) = do+    pack (Tree (Measured _ (MLayout ref _ _ axis)) sub) = do       when needPos runPos       mapMOf_ (each . Tree.subTree) pack sub-      traverse_ (resizeView vertical) sub+      traverse_ (resizeView axis) sub       where         needPos = needPositioning sub         runPos = do           viewsLog $ "repositioning views" <+> pretty sub-          traverse_ (positionView vertical ref) (NonEmpty.reverse sub)+          traverse_ (positionView axis ref) (NonEmpty.reverse sub)  packWindow ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>+  Members [AtomicState Views, Tmux] r =>   WindowState ->-  m ()+  Sem r () packWindow (WindowState (Codec.Window _ width height) _ _ tree _) = do   let measures = measureTree tree width height   viewsLog $ "measured tree:" <> line <> pretty measures
lib/Chiasma/Pane.hs view
@@ -2,13 +2,16 @@  import Chiasma.Data.Ident (Ident) import Chiasma.Data.TmuxId (PaneId)-import qualified Chiasma.Data.View as Tmux (View(View))+import qualified Chiasma.Data.View as Tmux (View (View)) import Chiasma.Data.Views (Views) import qualified Chiasma.View as Views (insertPane) -addPane :: MonadDeepState s Views m => Ident -> m (Tmux.View PaneId)-addPane ident = do-  modify $ Views.insertPane pane-  return pane+addPane ::+  Member (AtomicState Views) r =>+  Ident ->+  Sem r (Tmux.View PaneId)+addPane ident =+  pane <$ atomicModify' (Views.insertPane pane)   where-    pane = Tmux.View ident Nothing+    pane =+      Tmux.View ident Nothing
+ lib/Chiasma/Path.hs view
@@ -0,0 +1,16 @@+module Chiasma.Path where++import qualified Data.Text as Text+import Path (Path, toFilePath)++pathText :: Path b t -> Text+pathText =+  toText . toFilePath+{-# inline pathText #-}++pathText' :: Path b t -> Text+pathText' p =+  case pathText p of+    "/" -> "/"+    t -> Text.dropWhileEnd (== '/') t+{-# inline pathText' #-}
− lib/Chiasma/Prelude.hs
@@ -1,71 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-}--module Chiasma.Prelude (-  module Cornea,-  module Data.Default,-  module Data.Foldable,-  module Relude,-  dbg,-  dbgs,-  dbgm,-  makeClassy,-  mapLeft,-  tuple,-  undefined,-  unit,-  unsafeLogAnd,-  unsafeLogS,-  unsafeLogSAnd,-  (<$$>),-) where--import Control.Lens (makeClassy)-import Cornea-import Data.Default (Default(def))-import Data.Either.Combinators (mapLeft)-import Data.Foldable (foldl, traverse_)-import Data.Functor.Syntax ((<$$>))-import GHC.Err (undefined)-import GHC.IO.Unsafe (unsafePerformIO)-import Relude hiding (Type, ask, asks, get, gets, hoistEither, hoistMaybe, local, modify, put, state, undefined)--dbg :: Monad m => Text -> m ()-dbg msg = do-  () <- return $ unsafePerformIO (putStrLn (toString msg))-  return ()--dbgs :: Monad m => Show a => a -> m ()-dbgs =-  dbg . show--dbgm :: Monad m => Show a => m a -> m a-dbgm ma = do-  a <- ma-  dbgs a-  return a--unit ::-  Applicative f =>-  f ()-unit =-  pure ()--tuple ::-  Applicative f =>-  f a ->-  f b ->-  f (a, b)-tuple fa fb =-  (,) <$> fa <*> fb--unsafeLogSAnd :: Show a => a -> b -> b-unsafeLogSAnd a b =-  unsafePerformIO $ print a >> return b--unsafeLogAnd :: Text -> b -> b-unsafeLogAnd a b =-  unsafePerformIO $ putStrLn (toString a) >> return b--unsafeLogS :: Show a => a -> a-unsafeLogS a =-  unsafePerformIO $ print a >> return a
lib/Chiasma/Render.hs view
@@ -1,41 +1,47 @@ module Chiasma.Render where -import qualified Chiasma.Codec.Data as Codec (Window(Window))+import Path (Abs, Dir, Path)+import Prettyprinter (line, pretty)++import Chiasma.Codec.Data.Pane (Pane)+import qualified Chiasma.Codec.Data.Window as Codec (Window (Window))+import Chiasma.Data.CodecError (CodecError) import Chiasma.Data.Ident (Ident, identText)+import Chiasma.Data.Panes (TmuxPanes)+import qualified Chiasma.Data.RenderError as RenderError import Chiasma.Data.RenderError (RenderError)-import Chiasma.Data.TmuxThunk (TmuxThunk) import Chiasma.Data.Views (Views)+import Chiasma.Effect.TmuxApi (Tmux) import Chiasma.Pack (packWindow) import Chiasma.Session (ensureSession, findOrCreateSession) import Chiasma.Ui.Data.RenderableTree (RenderableTree) import Chiasma.Ui.Data.View (ViewTree) import Chiasma.View (viewsLog) import Chiasma.Window (ensureView, ensureWindow, findOrCreateWindow, windowState)-import Control.Monad.Error.Class (MonadError)-import Control.Monad.Free.Class (MonadFree)-import Data.Text.Prettyprint.Doc (line, pretty)  renderTree ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>+  Members [TmuxPanes Pane, AtomicState Views, Tmux] r =>   Ident ->   Codec.Window ->   RenderableTree ->-  m ()+  Sem r () renderTree windowIdent window tree = do   viewsLog $ pretty ("rendering tree in window " <> identText windowIdent <> ":") <> line <> pretty tree   wState <- windowState windowIdent window tree   packWindow wState  render ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m, MonadError RenderError m) =>-  FilePath ->+  Members [TmuxPanes Pane !! CodecError, AtomicState Views, Tmux !! CodecError, Stop RenderError] r =>+  Path Abs Dir ->   Ident ->   Ident ->   ViewTree ->-  m ()+  Sem r () render cwd sessionIdent windowIdent tree = do-  initialSession <- findOrCreateSession sessionIdent-  initialWindow <- findOrCreateWindow windowIdent-  (sid, newSessionWid) <- ensureSession initialSession initialWindow-  window@(Codec.Window windowId _ _) <- ensureWindow sid initialWindow newSessionWid tree-  traverse_ (renderTree windowIdent window) =<< ensureView cwd windowId tree+  resumeHoist @_ @(TmuxPanes _) RenderError.Codec do+    resumeHoist @_ @Tmux RenderError.Codec do+      initialSession <- findOrCreateSession sessionIdent+      initialWindow <- findOrCreateWindow windowIdent+      (sid, newSessionWid) <- mapStop RenderError.Layout (ensureSession initialSession initialWindow)+      window@(Codec.Window windowId _ _) <- ensureWindow sid initialWindow newSessionWid tree+      traverse_ (renderTree windowIdent window) =<< ensureView cwd windowId tree
lib/Chiasma/Session.hs view
@@ -1,49 +1,46 @@-{-# LANGUAGE FlexibleContexts #-}- module Chiasma.Session where -import Control.Monad.Free.Class (MonadFree)--import qualified Chiasma.Codec.Data as Codec (Session(Session), Window(Window))+import Exon (exon)+import qualified Chiasma.Codec.Data.Session as Codec (Session (Session))+import qualified Chiasma.Codec.Data.Window as Codec (Window (Window)) import Chiasma.Command.Session (existingSessionId, newSession) import Chiasma.Command.Window (newSessionWindow) import Chiasma.Data.Ident (Ident)+import Chiasma.Data.LayoutError (LayoutError) import Chiasma.Data.TmuxId (SessionId, WindowId)-import Chiasma.Data.TmuxThunk (TmuxThunk)-import qualified Chiasma.Data.View as Tmux (View(viewId, viewIdent), setViewId)+import qualified Chiasma.Data.View as Tmux (View (viewId, viewIdent), setViewId) import Chiasma.Data.Views (Views)+import Chiasma.Effect.TmuxApi (Tmux) import Chiasma.View (findOrCreateView, viewsLogS) import qualified Chiasma.View as Views (insertSession, session, updateSession, updateWindow)  findOrCreateSession ::-  MonadDeepState s Views m =>+  Member (AtomicState Views) r =>   Ident ->-  m (Tmux.View SessionId)+  Sem r (Tmux.View SessionId) findOrCreateSession =   findOrCreateView Views.session Views.insertSession  spawnSession ::-  MonadDeepState s Views m =>-  MonadFree TmuxThunk m =>+  Members [AtomicState Views, Tmux, Stop LayoutError] r =>   Tmux.View SessionId ->   Tmux.View WindowId ->-  m (SessionId, WindowId)+  Sem r (SessionId, WindowId) spawnSession session' window = do-  Codec.Session sid <- newSession (Tmux.viewIdent session')-  modify $ Views.updateSession $ Tmux.setViewId sid session'+  Codec.Session sid _ <- newSession (Tmux.viewIdent session')+  atomicModify' (Views.updateSession (Tmux.setViewId sid session'))   Codec.Window wid _ _ <- newSessionWindow sid-  modify $ Views.updateWindow $ Tmux.setViewId wid window-  viewsLogS $ "spawned session " <> show session' <> " with id " <> show sid <> " and window id " <> show wid-  return (sid, wid)+  atomicModify' (Views.updateWindow (Tmux.setViewId wid window))+  viewsLogS [exon|spawned session #{show session'} with id #{show sid} and window id #{show wid}|]+  pure (sid, wid)  ensureSession ::-  MonadDeepState s Views m =>-  MonadFree TmuxThunk m =>+  Members [AtomicState Views, Tmux, Stop LayoutError] r =>   Tmux.View SessionId ->   Tmux.View WindowId ->-  m (SessionId, Maybe WindowId)+  Sem r (SessionId, Maybe WindowId) ensureSession session' window = do   existing <- join <$> traverse existingSessionId (Tmux.viewId session')   case existing of-    Just sid -> return (sid, Nothing)+    Just sid -> pure (sid, Nothing)     Nothing -> second Just <$> spawnSession session' window
− lib/Chiasma/Test/File.hs
@@ -1,31 +0,0 @@-module Chiasma.Test.File(-  tempDirIO,-  tempDir,-  fixture,-) where--import System.Directory (canonicalizePath, createDirectoryIfMissing, removePathForcibly)-import System.FilePath ((</>))--testDir :: Text -> IO FilePath-testDir prefix = canonicalizePath $ "test" </> toString prefix---- raises exception if cwd is not the package root so we don't damage anything-tempDirIO :: Text -> FilePath -> IO FilePath-tempDirIO prefix path = do-  base <- testDir prefix-  let dir = base </> "temp"-  removePathForcibly dir-  createDirectoryIfMissing False dir-  let absPath = dir </> path-  createDirectoryIfMissing True absPath-  return absPath--tempDir :: MonadIO m => Text -> FilePath -> m FilePath-tempDir prefix path =-  liftIO $ tempDirIO prefix path--fixture :: MonadIO m => Text -> FilePath -> m FilePath-fixture prefix path = do-  base <- liftIO $ testDir prefix-  return $ base </> "fixtures" </> path
− lib/Chiasma/Test/Screenshot.hs
@@ -1,67 +0,0 @@-module Chiasma.Test.Screenshot where--import Control.Monad.Free.Class (MonadFree)-import qualified Data.ByteString as ByteString (writeFile)-import qualified Data.Text as Text (lines, unlines)-import qualified Data.Text.Encoding as Text (encodeUtf8)-import System.FilePath (takeDirectory, (</>))-import UnliftIO.Directory (createDirectoryIfMissing, doesFileExist)--import Chiasma.Command.Pane (capturePane)-import Chiasma.Data.TmuxId (PaneId(PaneId))-import Chiasma.Data.TmuxThunk (TmuxThunk)--loadScreenshot :: MonadIO m => FilePath -> m (Maybe Text)-loadScreenshot path =-  ifM (doesFileExist path) (Just . toText <$> liftIO (readFile path)) (pure Nothing)--storeScreenshot :: MonadIO m => FilePath -> [Text] -> m ()-storeScreenshot path text = do-  createDirectoryIfMissing True (takeDirectory path)-  liftIO $ ByteString.writeFile path (Text.encodeUtf8 . Text.unlines $ text)--takeScreenshot ::-  MonadFree TmuxThunk m =>-  MonadIO m =>-  Int ->-  m [Text]-takeScreenshot =-  capturePane . PaneId--recordScreenshot ::-  MonadFree TmuxThunk m =>-  MonadIO m =>-  FilePath ->-  Int ->-  m ()-recordScreenshot path paneId = do-  current <- takeScreenshot paneId-  storeScreenshot path current--testScreenshot ::-  MonadFree TmuxThunk m =>-  MonadIO m =>-  FilePath ->-  Int ->-  m (Maybe ([Text], [Text]))-testScreenshot path pane = do-  current <- takeScreenshot pane-  loadScreenshot path >>= check current-  where-    check current (Just existing) =-      return $ Just (current, Text.lines existing)-    check current Nothing =-      Nothing <$ storeScreenshot path current--screenshot ::-  MonadFree TmuxThunk m =>-  MonadIO m =>-  Bool ->-  FilePath ->-  Text ->-  Int ->-  m (Maybe ([Text], [Text]))-screenshot record storage name paneId =-  if record then Nothing <$ recordScreenshot path paneId else testScreenshot path paneId-  where-    path = storage </> toString name
− lib/Chiasma/Test/Tmux.hs
@@ -1,121 +0,0 @@-module Chiasma.Test.Tmux where--import Chiasma.Data.TmuxError (TmuxError)-import Chiasma.Monad.Stream (runTmux)-import qualified Chiasma.Monad.Tmux as Tmux (write)-import Chiasma.Native.Api (TmuxNative(..))-import Control.Concurrent (threadDelay)-import System.Directory (doesFileExist)-import System.FilePath ((</>))-import System.Posix.IO (fdToHandle)-import System.Posix.Pty (Pty, createPty, resizePty)-import qualified System.Posix.Signals as Signal (killProcess, signalProcess)-import System.Posix.Terminal (openPseudoTerminal)-import System.Process (getPid)-import System.Process.Typed (-  Process,-  ProcessConfig,-  StreamSpec,-  proc,-  setStderr,-  setStdin,-  setStdout,-  unsafeProcessHandle,-  useHandleClose,-  withProcessWait,-  )-import UnliftIO (finally, throwString)-import UnliftIO.Exception (tryAny)-import UnliftIO.Temporary (withSystemTempDirectory)--import Chiasma.Test.File (fixture)--data Terminal = Terminal Handle Pty--data TmuxTestConf =-  TmuxTestConf {-    ttcWidth :: Int,-    ttcHeight :: Int,-    ttcFontSize :: Int,-    ttcGui :: Bool-  }-  deriving (Eq, Show)--instance Default TmuxTestConf where-  def = TmuxTestConf 240 61 18 True--usleep :: MonadIO f => Double -> f ()-usleep =-  liftIO . threadDelay . round--sleep :: MonadIO f => Double -> f ()-sleep seconds =-  usleep $ seconds * 1e6--unsafeTerminal :: IO Terminal-unsafeTerminal = do-  (_, slave) <- openPseudoTerminal-  mayPty <- createPty slave-  handle <- fdToHandle slave-  pty <- maybe (throwString "couldn't spawn pty") return mayPty-  return $ Terminal handle pty--urxvtArgs :: Int -> Int -> Int -> [Text]-urxvtArgs width height fontSize =-  ["-geometry", show width <> "x" <> show height, "-fn", "xft:monospace:size=" <> show fontSize, "-e", "tmux"]--testTmuxProcessConfig :: TmuxTestConf -> FilePath -> FilePath -> Terminal -> IO (ProcessConfig () () ())-testTmuxProcessConfig (TmuxTestConf width height fontSize gui) socket confFile (Terminal handle pty) = do-  confFileExists <- doesFileExist confFile-  resizePty pty (width, height)-  let-    stream :: StreamSpec st ()-    stream = useHandleClose handle-    stdio = setStdin stream . setStdout stream . setStderr stream-    tmuxArgs = ["-S", toText socket, "-f", toText confFileArg]-    confFileArg = if confFileExists then confFile else "/dev/null"-    prc =-      if gui-      then proc "urxvt" (toString <$> urxvtArgs width height fontSize ++ tmuxArgs)-      else proc "tmux" (toString <$> tmuxArgs)-  return $ stdio prc--killPid :: Integral a => a -> IO ()-killPid =-  void . tryAny . Signal.signalProcess Signal.killProcess . fromIntegral--killProcess :: TmuxNative -> Process () () () -> IO ()-killProcess api prc = do-  _ <- runExceptT @TmuxError $ runTmux api $ Tmux.write "kill-server" []-  let handle = unsafeProcessHandle prc-  mayPid <- getPid handle-  maybe (return ()) killPid mayPid---- FIXME find a way to wait for tmux deterministically instead of sleeping--- if the first tmux control mode process from a TmuxProg runs before urxvt has started the server,--- it will not use the test tmux.conf--- maybe start tmux first, then urxvt?-runAndKillTmux :: (TmuxNative -> IO a) -> TmuxNative -> Process () () () -> IO a-runAndKillTmux thunk api prc = do-  sleep 0.2-  finally (thunk api) (killProcess api prc)--withTestTmux :: TmuxTestConf -> (TmuxNative -> IO a) -> FilePath -> IO a-withTestTmux tConf thunk tempDir = do-  let socket = tempDir </> "tmux_socket"-  conf <- fixture "u" "tmux.conf"-  terminal <- unsafeTerminal-  pc <- testTmuxProcessConfig tConf socket conf terminal-  withProcessWait pc $ runAndKillTmux thunk (TmuxNative $ Just socket)--tmuxSpec' :: TmuxTestConf -> (TmuxNative -> IO a) -> IO a-tmuxSpec' conf thunk =-  withSystemTempDirectory "chiasma-test" $ withTestTmux conf thunk--tmuxSpec :: (TmuxNative -> IO a) -> IO a-tmuxSpec =-  tmuxSpec' def { ttcGui = False }--tmuxGuiSpec :: (TmuxNative -> IO a) -> IO a-tmuxGuiSpec =-  tmuxSpec' def
+ lib/Chiasma/Tmux.hs view
@@ -0,0 +1,89 @@+module Chiasma.Tmux where++import Polysemy.Internal (hoistSem)+import Polysemy.Internal.Sing (KnownList (singList))+import Polysemy.Internal.Union (hoist, weakenMid)++import Chiasma.Data.Panes (Panes, TmuxPanes)+import Chiasma.Effect.Codec (Codec)+import Chiasma.Effect.TmuxApi (TmuxApi)+import Chiasma.Effect.TmuxClient (ScopedTmux, TmuxClient)+import Chiasma.Interpreter.TmuxApi (+  InterpretApis (interpretApis),+  RestopApis (restopApis),+  TmuxApis,+  interpretTmuxApi,+  type (<$>),+  )++withTmuxApis' ::+  ∀ commands err i o r a .+  InterpretApis commands err i o r =>+  Member (ScopedTmux i o) r =>+  Sem (TmuxApis commands err ++ TmuxClient i o : r) a ->+  Sem r a+withTmuxApis' =+  scoped_ . interpretApis @commands @err++insertAfter ::+  ∀ left e r a .+  KnownList left =>+  Sem (left ++ r) a ->+  Sem (left ++ e : r) a+insertAfter =+  hoistSem $ hoist (insertAfter @left @e @r) . weakenMid @r (singList @left) (singList @'[e])++withTmuxApis ::+  ∀ commands err i o r .+  KnownList (TmuxApis commands err) =>+  InterpretApis commands err i o r =>+  Member (ScopedTmux i o) r =>+  InterpretersFor (TmuxApis commands err) r+withTmuxApis =+  scoped_ .+  interpretApis @commands @err .+  insertAfter @(TmuxApis commands err) @(TmuxClient i o) @r++withTmuxApis_ ::+  ∀ commands err i o apis r .+  apis ~ TmuxApi <$> commands =>+  KnownList apis =>+  RestopApis commands err i o r =>+  Member (ScopedTmux i o) r =>+  InterpretersFor apis r+withTmuxApis_ =+  scoped_ .+  restopApis @commands @err .+  insertAfter @apis @(TmuxClient i o) @r++withTmux ::+  ∀ command err i o r .+  Members [ScopedTmux i o, Codec command i o !! err] r =>+  InterpreterFor (TmuxApi command !! err) r+withTmux =+  scoped_ . interpretTmuxApi . raiseUnder++withTmux_ ::+  ∀ command err i o r .+  Members [ScopedTmux i o, Codec command i o !! err, Stop err] r =>+  InterpreterFor (TmuxApi command) r+withTmux_ =+  scoped_ .+  interpretTmuxApi .+  raiseUnder .+  restop @err @(TmuxApi command) .+  raiseUnder++withPanes ::+  ∀ p err i o r .+  Members [ScopedTmux i o, Codec (Panes p) i o !! err] r =>+  InterpreterFor (TmuxPanes p !! err) r+withPanes =+  withTmux++withPanes_ ::+  ∀ p err i o r .+  Members [ScopedTmux i o, Codec (Panes p) i o !! err, Stop err] r =>+  InterpreterFor (TmuxPanes p) r+withPanes_ =+  withTmux_
+ lib/Chiasma/TmuxApi.hs view
@@ -0,0 +1,7 @@+module Chiasma.TmuxApi (+  module Chiasma.Effect.TmuxApi,+  module Chiasma.Interpreter.TmuxApi,+) where++import Chiasma.Effect.TmuxApi+import Chiasma.Interpreter.TmuxApi
+ lib/Chiasma/TmuxNative.hs view
@@ -0,0 +1,68 @@+module Chiasma.TmuxNative where++import Polysemy.Internal.Sing (KnownList)++import Chiasma.Data.CodecError (CodecError)+import Chiasma.Data.Panes (Panes, TmuxPanes)+import Chiasma.Data.TmuxRequest (TmuxRequest)+import Chiasma.Data.TmuxResponse (TmuxResponse)+import Chiasma.Effect.Codec (NativeCodecE)+import Chiasma.Effect.TmuxApi (TmuxApi)+import Chiasma.Effect.TmuxClient (NativeTmux, TmuxClient)+import Chiasma.Interpreter.TmuxApi (InterpretApisNative, RestopApisNative, TmuxApis, type (<$>))+import Chiasma.Tmux (withTmux, withTmuxApis, withTmuxApis', withTmuxApis_, withTmux_)++withTmuxApisNative' ::+  ∀ commands r a .+  InterpretApisNative commands r =>+  Member NativeTmux r =>+  Sem (TmuxApis commands CodecError ++ TmuxClient TmuxRequest TmuxResponse : r) a ->+  Sem r a+withTmuxApisNative' =+  withTmuxApis' @commands @CodecError++withTmuxApisNative ::+  ∀ commands r .+  KnownList (TmuxApis commands CodecError) =>+  InterpretApisNative commands r =>+  Member NativeTmux r =>+  InterpretersFor (TmuxApis commands CodecError) r+withTmuxApisNative =+  withTmuxApis @commands @CodecError++withTmuxApisNative_ ::+  ∀ commands r .+  KnownList (TmuxApi <$> commands) =>+  RestopApisNative commands r =>+  Member NativeTmux r =>+  InterpretersFor (TmuxApi <$> commands) r+withTmuxApisNative_ =+  withTmuxApis_ @commands @CodecError++withTmuxNative ::+  ∀ command r .+  Members [NativeTmux, NativeCodecE command] r =>+  InterpreterFor (TmuxApi command !! CodecError) r+withTmuxNative =+  withTmux++withTmuxNative_ ::+  ∀ command r .+  Members [NativeTmux, NativeCodecE command, Stop CodecError] r =>+  InterpreterFor (TmuxApi command) r+withTmuxNative_ =+  withTmux_++withPanesNative ::+  ∀ p r .+  Members [NativeTmux, NativeCodecE (Panes p)] r =>+  InterpreterFor (TmuxPanes p !! CodecError) r+withPanesNative =+  withTmuxNative++withPanesNative_ ::+  ∀ p r .+  Members [NativeTmux, NativeCodecE (Panes p), Stop CodecError] r =>+  InterpreterFor (TmuxPanes p) r+withPanesNative_ =+  withTmuxNative_
lib/Chiasma/Ui/Data/Measure.hs view
@@ -1,8 +1,10 @@ module Chiasma.Ui.Data.Measure where -import Chiasma.Data.TmuxId (PaneId(..))-import Data.Text.Prettyprint.Doc (Pretty(..), (<+>))+import Control.Lens (makeClassy)+import Prettyprinter (Pretty (..), (<+>)) +import Chiasma.Data.Axis (Axis)+import Chiasma.Data.TmuxId (PaneId (..)) import Chiasma.Ui.Data.Tree (NNode, NTree)  data MPane =@@ -11,7 +13,7 @@     _mainPosition :: Int,     _offPosition :: Int   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  makeClassy ''MPane @@ -20,9 +22,9 @@     _reference :: PaneId,     _lMainPosition :: Int,     _lOffPosition :: Int,-    _vertical :: Bool+    _axis :: Axis   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  makeClassy ''MLayout @@ -31,7 +33,7 @@     _size :: Int,     _view :: a   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  makeClassy ''Measured @@ -39,9 +41,8 @@ type MeasureTreeSub = NNode (Measured MLayout) (Measured MPane)  instance Pretty MLayout where-  pretty (MLayout (PaneId refId) mainPos offPos vertical') =-    "l –" <+> "ref:" <+> pretty refId <+> "pos:" <+> pretty mainPos <+> "(" <> pretty offPos <> ")" <+>-      if vertical' then "v" else "h"+  pretty (MLayout (PaneId refId) mainPos offPos axis') =+    "l –" <+> "ref:" <+> pretty refId <+> "pos:" <+> pretty mainPos <+> "(" <> pretty offPos <> ")" <+> pretty axis'  instance Pretty MPane where   pretty (MPane (PaneId paneId') mainPos offPos) =
lib/Chiasma/Ui/Data/RenderableTree.hs view
@@ -1,18 +1,19 @@ module Chiasma.Ui.Data.RenderableTree where -import Data.Text.Prettyprint.Doc (Doc, Pretty(..), emptyDoc, space, (<+>))+import Prettyprinter (Doc, Pretty (..), emptyDoc, space, (<+>)) -import Chiasma.Data.TmuxId (PaneId(..))+import Chiasma.Data.Axis (Axis)+import Chiasma.Data.TmuxId (PaneId (..)) import Chiasma.Ui.Data.Tree (NNode, NTree)-import Chiasma.Ui.Data.ViewGeometry (ViewGeometry(ViewGeometry))+import Chiasma.Ui.Data.ViewGeometry (ViewGeometry (ViewGeometry)) import Chiasma.Ui.Data.ViewState (ViewState)  data RLayout =   RLayout {     _ref :: RPane,-    _vertical :: Bool+    _axis :: Axis   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  data RPane =   RPane {@@ -20,7 +21,7 @@     _top :: Int,     _left :: Int   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  data Renderable a =   Renderable {@@ -28,7 +29,7 @@     _geometry :: ViewGeometry,     _view :: a   }-  deriving (Eq, Show)+  deriving stock (Eq, Show)  type RenderableLayout = Renderable RLayout type RenderablePane = Renderable RPane@@ -36,8 +37,8 @@ type RenderableNode = NNode RenderableLayout RenderablePane  instance Pretty RLayout where-  pretty (RLayout (RPane (PaneId refId) _ _) vertical) =-    "l –" <+> "ref:" <+> pretty refId <+> "pos:" <+> if vertical then "v" else "h"+  pretty (RLayout (RPane (PaneId refId) _ _) axis) =+    "l –" <+> "ref:" <+> pretty refId <+> "pos:" <+> pretty axis  instance Pretty RPane where   pretty (RPane (PaneId paneId) top left) =
lib/Chiasma/Ui/Data/Tree.hs view
@@ -1,8 +1,7 @@-{-# LANGUAGE TemplateHaskell #-}- module Chiasma.Ui.Data.Tree where -import Data.Text.Prettyprint.Doc (Pretty(..), vsep, nest)+import Control.Lens (makeClassy)+import Prettyprinter (Pretty (..), nest, vsep)  data Tree f l p =   Tree {@@ -10,11 +9,11 @@     _forest :: f (Node f l p)     } -deriving instance (Eq l, Eq p) => Eq (Tree [] l p)-deriving instance (Show l, Show p) => Show (Tree [] l p)+deriving stock instance (Eq l, Eq (Node [] l p)) => Eq (Tree [] l p)+deriving stock instance (Show l, Show (Node [] l p)) => Show (Tree [] l p) -deriving instance (Eq l, Eq p) => Eq (Tree NonEmpty l p)-deriving instance (Show l, Show p) => Show (Tree NonEmpty l p)+deriving stock instance (Eq l, Eq (Node NonEmpty l p)) => Eq (Tree NonEmpty l p)+deriving stock instance (Show l, Show (Node NonEmpty l p)) => Show (Tree NonEmpty l p)  data Node f l p =   Sub { _subTree :: Tree f l p }@@ -24,11 +23,11 @@ makeClassy ''Tree makeClassy ''Node -deriving instance (Eq l, Eq p) => Eq (Node [] l p)-deriving instance (Show l, Show p) => Show (Node [] l p)+deriving stock instance (Eq l, Eq p) => Eq (Node [] l p)+deriving stock instance (Show l, Show p) => Show (Node [] l p) -deriving instance (Eq l, Eq p) => Eq (Node NonEmpty l p)-deriving instance (Show l, Show p) => Show (Node NonEmpty l p)+deriving stock instance (Eq l, Eq p) => Eq (Node NonEmpty l p)+deriving stock instance (Show l, Show p) => Show (Node NonEmpty l p)  type LTree l p = Tree [] l p type LNode l p = Node [] l p
lib/Chiasma/Ui/Data/TreeModError.hs view
@@ -1,6 +1,7 @@ module Chiasma.Ui.Data.TreeModError where  import Chiasma.Data.Ident (Ident)+ import Chiasma.Ui.Data.View (LayoutView, PaneView)  data TreeModError =@@ -17,6 +18,4 @@   AmbiguousLayout Ident Int   |   NoTrees-  deriving (Eq, Show)--deepPrisms ''TreeModError+  deriving stock (Eq, Show)
lib/Chiasma/Ui/Data/View.hs view
@@ -1,23 +1,24 @@ module Chiasma.Ui.Data.View where -import Chiasma.Data.Ident (Ident, Identifiable(..))-import Control.Lens (Index, IxValue, Ixed(ix), makeClassy_)+import Control.Lens (Index, IxValue, Ixed (ix), makeClassy, makeClassy_) import Control.Lens.Plated (Plated)+import Data.Bifoldable (Bifoldable (bifoldMap)) import Data.Data (Data)-import Data.Text.Prettyprint.Doc (Doc, Pretty(..), emptyDoc, nest, space, vsep, (<+>))-import Prelude hiding (state)+import Prettyprinter (Doc, Pretty (..), emptyDoc, nest, space, vsep, (<+>)) +import Chiasma.Data.Axis (Axis (Horizontal, Vertical))+import Chiasma.Data.Ident (Ident, Identifiable (..)) import Chiasma.Ui.Data.ViewGeometry (ViewGeometry)-import Chiasma.Ui.Data.ViewState (ViewState(ViewState))+import Chiasma.Ui.Data.ViewState (ViewState (ViewState)) import Chiasma.Ui.Lens.Ident (matchIdentP)  data Pane =   Pane {     _open :: Bool,     _pin :: Bool,-    _cwd :: Maybe FilePath+    _cwd :: Maybe Text   }-  deriving (Eq, Show, Data, Generic)+  deriving stock (Eq, Show, Data, Generic)  makeClassy ''Pane @@ -26,15 +27,13 @@  newtype Layout =   Layout {-    vertical :: Bool+    axis :: Axis   }-  deriving (Eq, Show, Data, Generic)+  deriving stock (Eq, Show, Data, Generic)+  deriving newtype (Default)  makeClassy_ ''Layout -instance Default Layout where-  def = Layout True- data View a =   View {     _ident :: Ident,@@ -42,7 +41,7 @@     _geometry :: ViewGeometry,     _extra :: a   }-  deriving (Eq, Show, Data, Generic)+  deriving stock (Eq, Show, Data, Generic)  makeClassy ''View @@ -53,8 +52,11 @@ type LayoutView = View Layout  instance Pretty Layout where-  pretty (Layout vertical) =-    if vertical then "▤" else "▥"+  pretty = \case+    Layout Vertical ->+      "➡"+    Layout Horizontal ->+      "⬇"  instance Pretty Pane where   pretty (Pane open' pin' _) =@@ -75,16 +77,16 @@ consPane :: Ident -> PaneView consPane ident' = View ident' (ViewState False) def (Pane False False Nothing) -consLayoutAs :: Bool -> Ident -> LayoutView-consLayoutAs vert ident' = View ident' (ViewState False) def (Layout vert)+consLayoutAs :: Axis -> Ident -> LayoutView+consLayoutAs axis ident' = View ident' (ViewState False) def (Layout axis)  consLayout :: Ident -> LayoutView consLayout =-  consLayoutAs False+  consLayoutAs Horizontal  consLayoutVertical :: Ident -> LayoutView consLayoutVertical =-  consLayoutAs True+  consLayoutAs Vertical  instance Identifiable (View a) where   identify = _ident@@ -95,7 +97,7 @@     treeData :: l,     treeSubs :: [TreeSub l p]     }-  deriving (Eq, Show, Data, Generic)+  deriving stock (Eq, Show, Data, Generic)  instance Bifunctor Tree where   first f (Tree l sub) = Tree (f l) (fmap (first f) sub)@@ -110,7 +112,7 @@   TreeNode { _subTree :: Tree l p }   |   TreeLeaf { _leafData :: p }-  deriving (Eq, Show, Data, Generic)+  deriving stock (Eq, Show, Data, Generic)  instance Bifunctor TreeSub where   first f (TreeNode t) = TreeNode (first f t)@@ -138,7 +140,8 @@ type instance IxValue (Tree l p) = Tree l p  instance Identifiable l => Ixed (Tree l p) where-  ix = matchIdentP+  ix i =+    matchIdentP i  instance (Pretty l, Pretty p) => Pretty (TreeSub l p) where   pretty (TreeNode a) =
lib/Chiasma/Ui/Data/ViewGeometry.hs view
@@ -1,9 +1,7 @@-{-# LANGUAGE DeriveAnyClass #-}- module Chiasma.Ui.Data.ViewGeometry where  import Data.Data (Data)-import Data.Text.Prettyprint.Doc (Doc, Pretty(..), emptyDoc, space, (<+>))+import Prettyprinter (Doc, Pretty (..), emptyDoc, space, (<+>))  data ViewGeometry =   ViewGeometry {@@ -14,7 +12,8 @@     weight :: Maybe Float,     position :: Maybe Float   }-  deriving (Eq, Show, Data, Generic, Default)+  deriving stock (Eq, Show, Data, Generic)+  deriving anyclass (Default)  mayPretty :: Text -> Maybe Float -> Doc a mayPretty prefix (Just a) =
lib/Chiasma/Ui/Data/ViewState.hs view
@@ -6,7 +6,7 @@   ViewState {     minimized :: Bool   }-  deriving (Eq, Show, Data, Generic)+  deriving stock (Eq, Show, Data, Generic)  instance Default ViewState where   def = ViewState False
lib/Chiasma/Ui/Lens/Ident.hs view
@@ -1,23 +1,21 @@-{-# LANGUAGE RankNTypes #-}+module Chiasma.Ui.Lens.Ident where -module Chiasma.Ui.Lens.Ident(-  matchIdent,-  matchIdentL,-  matchIdentP,-) where+import Control.Lens (Prism', prism) -import Control.Lens (Traversal', Prism', filtered, each, prism)-import Chiasma.Data.Ident (Ident, Identifiable(..), sameIdent)+import Chiasma.Data.Ident (Ident, Identifiable (..), sameIdent)  matchIdent :: Identifiable a => Ident -> Traversal' a a-matchIdent = filtered . sameIdent+matchIdent i =+  filtered (sameIdent i)  matchIdentL :: Identifiable a => Ident -> Traversal' [a] a-matchIdentL ident = each . matchIdent ident+matchIdentL ident =+  each . matchIdent ident  identEither :: Identifiable a => Ident -> a -> Either a a identEither target a =   if sameIdent target a then Right a else Left a  matchIdentP :: Identifiable a => Ident -> Prism' a a-matchIdentP ident = prism id (identEither ident)+matchIdentP ident =+  prism id (identEither ident)
lib/Chiasma/Ui/Measure.hs view
@@ -1,15 +1,15 @@ module Chiasma.Ui.Measure where  import qualified Data.List.NonEmpty as NonEmpty (zip)-import GHC.Float (int2Float) -import Chiasma.Data.Maybe (orElse)-import Chiasma.Ui.Data.Measure (MLayout(..), MPane(..), MeasureTree, MeasureTreeSub, Measured(..))-import Chiasma.Ui.Data.RenderableTree (RLayout(..), RPane(..), Renderable(..), RenderableNode, RenderableTree)-import Chiasma.Ui.Data.Tree (Tree(..))-import qualified Chiasma.Ui.Data.Tree as Tree (Node(..))-import Chiasma.Ui.Data.ViewGeometry (ViewGeometry(minSize, maxSize, fixedSize))-import Chiasma.Ui.Data.ViewState (ViewState(ViewState))+import qualified Chiasma.Data.Axis as Axis+import Chiasma.Data.Axis (Axis (Horizontal, Vertical))+import Chiasma.Ui.Data.Measure (MLayout (..), MPane (..), MeasureTree, MeasureTreeSub, Measured (..))+import Chiasma.Ui.Data.RenderableTree (RLayout (..), RPane (..), Renderable (..), RenderableNode, RenderableTree)+import Chiasma.Ui.Data.Tree (Tree (..))+import qualified Chiasma.Ui.Data.Tree as Tree (Node (..))+import Chiasma.Ui.Data.ViewGeometry (ViewGeometry (fixedSize, maxSize, minSize))+import Chiasma.Ui.Data.ViewState (ViewState (ViewState)) import Chiasma.Ui.Measure.Balance (balanceSizes) import Chiasma.Ui.Measure.Weights (viewWeights) @@ -22,7 +22,7 @@  actualSize :: (ViewGeometry -> Maybe Float) ->  ViewState -> ViewGeometry -> Maybe Float actualSize getter viewState viewGeom =-  orElse (getter viewGeom) (effectiveFixedSize viewState viewGeom)+  getter viewGeom <|> effectiveFixedSize viewState viewGeom  actualMinSizes :: NonEmpty (ViewState, ViewGeometry) -> NonEmpty Float actualMinSizes =@@ -44,7 +44,7 @@   balanceSizes minSizes maxSizes weights minimized cells   where     measureData = fmap subMeasureData views-    paneSpacers = int2Float (length views) - 1.0+    paneSpacers = fromIntegral (length views) - 1.0     cells = total - paneSpacers     sizesInCells s = if s > 1 then s else s * cells     minSizes = fmap sizesInCells (actualMinSizes measureData)@@ -52,25 +52,28 @@     minimized = fmap (uncurry isMinimized) measureData     weights = viewWeights measureData -measureSub :: Int -> Int -> Bool -> RenderableNode -> Int -> MeasureTreeSub-measureSub width height vertical (Tree.Sub tree) size =-  Tree.Sub $ measureLayout tree newWidth newHeight vertical+measureSub :: Int -> Int -> Axis -> RenderableNode -> Int -> MeasureTreeSub+measureSub width height axis (Tree.Sub tree) size =+  Tree.Sub (measureLayout tree newWidth newHeight axis)   where-    (newWidth, newHeight) = if vertical then (width, size) else (size, height)-measureSub _ _ vertical (Tree.Leaf (Renderable _ _ (RPane paneId top left))) size =+    (newWidth, newHeight) =+      case axis of+        Vertical -> (width, size)+        Horizontal -> (size, height)+measureSub _ _ (Axis.vertical -> vertical) (Tree.Leaf (Renderable _ _ (RPane paneId top left))) size =   Tree.Leaf (Measured size (MPane paneId (if vertical then top else left) (if vertical then left else top))) -measureLayout :: RenderableTree -> Int -> Int -> Bool -> MeasureTree-measureLayout (Tree (Renderable _ _ (RLayout (RPane refId refTop refLeft) vertical)) sub) width height parentVertical =-  Tree (Measured sizeInParent (MLayout refId mainPos offPos vertical)) measuredSub+measureLayout :: RenderableTree -> Int -> Int -> Axis -> MeasureTree+measureLayout (Tree (Renderable _ _ (RLayout (RPane refId refTop refLeft) axis)) sub) width height (Axis.vertical -> parentVertical) =+  Tree (Measured sizeInParent (MLayout refId mainPos offPos axis)) measuredSub   where     sizeInParent = if parentVertical then height else width     mainPos = if parentVertical then refTop else refLeft     offPos = if parentVertical then refLeft else refTop-    subTotalSize = if vertical then height else width-    sizes = measureLayoutViews (int2Float subTotalSize) sub-    measuredSub = uncurry (measureSub width height vertical) <$> NonEmpty.zip sub sizes+    subTotalSize = if Axis.vertical axis then height else width+    sizes = measureLayoutViews (fromIntegral subTotalSize) sub+    measuredSub = uncurry (measureSub width height axis) <$> NonEmpty.zip sub sizes  measureTree :: RenderableTree -> Int -> Int -> MeasureTree measureTree tree width height =-  measureLayout tree width height False+  measureLayout tree width height Horizontal
lib/Chiasma/Ui/Measure/Balance.hs view
@@ -1,14 +1,7 @@ module Chiasma.Ui.Measure.Balance where  import Data.List (zipWith3)-import qualified Data.List.NonEmpty as NonEmpty (-  filter,-  toList,-  zip,-  zipWith,-  )-import GHC.Float (float2Int, int2Float)-import GHC.Float.RealFracMethods (floorFloatInt)+import qualified Data.List.NonEmpty as NonEmpty  import Chiasma.Ui.Measure.Weights (   amendAndNormalizeWeights,@@ -30,24 +23,37 @@  reverseWeights :: NonEmpty Float -> NonEmpty Float reverseWeights weights =-  if norm > 0 then fmap (/ norm) r else r+  rev <$> r   where-    r = fmap (1 -) weights-    norm = sum r+    rev a =+      fromMaybe a (a / norm)+    r =+      fmap (1 -) weights+    norm =+      sum r  cutSizes :: Balance -> NonEmpty Float-cutSizes (Balance min' _ weights _ total) =-  fmap addDist cut+cutSizes (Balance minSizes _ weights _ total) =+  addNegatives <$> truncatedWeighted   where-    surplus = sum min' - total-    dist = fmap (surplus *) (reverseWeights weights)-    cut = fmap (uncurry (-)) (NonEmpty.zip min' dist)-    negOrZero a = if a < 0 then a else 0-    neg = fmap negOrZero cut-    negTotal = sum neg-    negCount = length (NonEmpty.filter (< 0) neg)-    dist2 = negTotal / int2Float (length min' - negCount)-    addDist a = if a < 0 then 0 else a + dist2+    surplus =+      sum minSizes - total+    surplusDistWeighted =+      fmap (surplus *) (reverseWeights weights)+    truncatedWeighted =+      fmap (uncurry (-)) (NonEmpty.zip minSizes surplusDistWeighted)+    negOrZero a =+      if a < 0 then a else 0+    neg =+      fmap negOrZero truncatedWeighted+    negTotal =+      sum neg+    negCount =+      length (NonEmpty.filter (< 0) neg)+    negativesDist =+      fromMaybe 0 (negTotal / realToFrac (length minSizes - negCount))+    addNegatives a =+      if a < 0 then 0 else a + negativesDist  distributeOnUnbounded :: Balance -> NonEmpty Float distributeOnUnbounded (Balance min' max' weights _ total) =@@ -121,28 +127,37 @@     maxTotal = sum (catMaybes $ NonEmpty.toList $ balanceMax balance)  roundSizes :: NonEmpty Float -> NonEmpty Int-roundSizes (head' :| tail') =-  roundedHead + (float2Int surplus) :| roundedTail+roundSizes (h :| t) =+  roundedHead + round surplus :| roundedTail   where-    (surplus, roundedTail) = mapAccumL folder diff0 tail'-    (roundedHead, diff0) = diff head'+    (surplus, roundedTail) = mapAccumL folder diff0 t+    (roundedHead, diff0) = diff h     folder z a =       (z + z1, a1)       where         (a1, z1) = diff a-    diff a = (floorFloatInt a, a - int2Float (floor a))+    diff a = (floor a, a - fromIntegral (floor a :: Int)) +-- |Tmux doesn't render panes smaller than two cells. ensureMinimum2 :: NonEmpty Float -> NonEmpty Float ensureMinimum2 sizes =   choose <$> positives   where-    positive = max 0-    positives = positive <$> sizes-    positivesCount = length $ NonEmpty.filter (>= 2) sizes-    unders = amountUnderTwo <$> positives-    sub = sum unders / int2Float positivesCount-    amountUnderTwo a = positive (2 - a)-    choose a = max 2 (a - sub)+    positive =+      max 0+    positives =+      positive <$> sizes+    overTwoCount =+      length (NonEmpty.filter (>= 2) sizes)+    unders =+      amountUnderTwo <$> positives+    -- If no sizes are larger than 2, nothing will have to be subtracted, all sizes will be clamped to 2+    amountUnderTwoDist =+      fromMaybe 0 (sum unders / realToFrac overTwoCount)+    amountUnderTwo a =+      positive (2 - a)+    choose a =+      max 2 (a - amountUnderTwoDist)  rectifySizes :: NonEmpty Float -> NonEmpty Int rectifySizes =
lib/Chiasma/Ui/Measure/Weights.hs view
@@ -1,14 +1,9 @@-module Chiasma.Ui.Measure.Weights(-  viewWeights,-  normalizeWeights,-  amendAndNormalizeWeights,-) where+module Chiasma.Ui.Measure.Weights where -import qualified Data.List.NonEmpty as NonEmpty (toList, filter)-import GHC.Float (int2Float)+import qualified Data.List.NonEmpty as NonEmpty (filter, toList) -import Chiasma.Ui.Data.ViewGeometry (ViewGeometry(ViewGeometry))-import Chiasma.Ui.Data.ViewState (ViewState(ViewState))+import Chiasma.Ui.Data.ViewGeometry (ViewGeometry (ViewGeometry))+import Chiasma.Ui.Data.ViewState (ViewState (ViewState))  effectiveWeight :: ViewState -> ViewGeometry -> Maybe Float effectiveWeight (ViewState minimized) (ViewGeometry _ _ fixedSize _ weight _) =@@ -18,18 +13,21 @@ amendWeights weights =   fmap (fromMaybe emptyWeight) weights   where-    total = sum (catMaybes $ NonEmpty.toList weights)-    normTotal = if total == 0 then 1 else total-    empties = length (NonEmpty.filter isNothing weights)-    normEmpties = if empties == 0 then 1 else empties-    emptyWeight = normTotal / int2Float normEmpties+    total =+      sum (catMaybes (NonEmpty.toList weights))+    normTotal =+      if total == 0 then 1 else total+    empties =+      length (NonEmpty.filter isNothing weights)+    emptyWeight =+      fromMaybe normTotal (normTotal / realToFrac empties)  normalizeWeights :: NonEmpty Float -> NonEmpty Float normalizeWeights weights =-  fmap (/ normTotal) weights+  fmap norm weights   where-    total = sum weights-    normTotal = if total == 0 then 1 else total+    norm a =+      fromMaybe a (a / sum weights)  amendAndNormalizeWeights :: NonEmpty (Maybe Float) -> NonEmpty Float amendAndNormalizeWeights = normalizeWeights . amendWeights
lib/Chiasma/Ui/ShowTree.hs view
@@ -3,11 +3,11 @@ import Chiasma.Data.Ident (identText) import Chiasma.Ui.Data.View (   LayoutView,-  Pane(Pane),+  Pane (Pane),   PaneView,-  Tree(Tree),-  TreeSub(TreeNode, TreeLeaf),-  View(View),+  Tree (Tree),+  TreeSub (TreeLeaf, TreeNode),+  View (View),   ViewTree,   ) @@ -38,4 +38,8 @@ showViewTree = showTree . formatViewTree  printViewTree :: MonadIO m => ViewTree -> m ()-printViewTree = liftIO . traverse_ putStrLn . fmap toString . showViewTree+printViewTree =+  liftIO .+  traverse_ putStrLn .+  fmap toString .+  showViewTree
lib/Chiasma/Ui/ViewTree.hs view
@@ -1,41 +1,34 @@ module Chiasma.Ui.ViewTree where +import Control.Lens (anyOf, cosmos, ix, mapMOf, transformM)+import Control.Monad.Trans.Class (lift)+import Control.Monad.Trans.Except (ExceptT (ExceptT), runExceptT)+import Control.Monad.Trans.Writer (WriterT, runWriterT, tell)+import Data.Composition ((.:))+import Data.Semigroup (Sum (Sum))+import Exon (exon)+import Prelude hiding (ix, tell)+ import Chiasma.Data.Ident (Ident) import Chiasma.Lens.Tree (-  LeafIndexTree(..),+  LeafIndexTree (..),   _litTree,   leafDataTraversal,   )-import Control.Lens (-  Traversal,-  Traversal',-  anyOf,-  cosmos,-  filtered,-  has,-  ix,-  mapMOf,-  over,-  transformM,-  )-import Control.Monad.Error.Class (throwError)-import Control.Monad.Trans.Writer (WriterT, runWriterT, tell)-import Data.Composition ((.:))--import Chiasma.Ui.Data.TreeModError (TreeModError(PaneMissing, AmbiguousPane, LayoutMissing, AmbiguousLayout))+import Chiasma.Ui.Data.TreeModError (TreeModError (AmbiguousLayout, AmbiguousPane, LayoutMissing, PaneMissing)) import Chiasma.Ui.Data.View (-  Pane(Pane),+  Pane (Pane),   PaneView,-  Tree(Tree),-  TreeSub(TreeNode, TreeLeaf),-  View(View),+  Tree (Tree),+  TreeSub (TreeLeaf, TreeNode),+  View (View),   ViewTree,   ViewTreeSub,   ) import qualified Chiasma.Ui.Data.View as Pane (open) import qualified Chiasma.Ui.Data.View as TreeSub (leafData) import qualified Chiasma.Ui.Data.View as View (extra)-import Chiasma.Ui.Data.ViewState (ViewState(ViewState))+import Chiasma.Ui.Data.ViewState (ViewState (ViewState)) import Chiasma.Ui.Pane (paneSetOpen, paneToggleOpen)  modCounted :: Monad m => (a -> m a) -> a -> WriterT (Sum Int) m a@@ -55,9 +48,9 @@   let st = (transformM $ mapMOf (ix ident) (modCounted f)) tree   (result, Sum count) <- lift $ runWriterT st   case count of-    1 -> return result-    0 -> throwError $ LayoutMissing ident-    n -> throwError $ AmbiguousLayout ident n+    1 -> pure result+    0 -> ExceptT (pure (Left (LayoutMissing ident)))+    n -> ExceptT (pure (Left (AmbiguousLayout ident n)))  toggleLayout1 :: Ident -> ViewTree -> Either TreeModError ViewTree toggleLayout1 ident tree =@@ -68,9 +61,9 @@   let st = (transformM $ mapMOf (ix ident) (modCounted f)) (LeafIndexTree tree)   (result, Sum count) <- lift $ runWriterT st   case count of-    1 -> return $ litTree result-    0 -> throwError $ PaneMissing ident-    n -> throwError $ AmbiguousPane ident n+    1 -> pure $ litTree result+    0 -> ExceptT (pure (Left (PaneMissing ident)))+    n -> ExceptT (pure (Left (AmbiguousPane ident n)))  modifyPane :: (PaneView -> PaneView) -> Ident -> ViewTree -> Either TreeModError ViewTree modifyPane modification ident tree =@@ -115,7 +108,7 @@   Multiple Int   |   Consistent-  deriving (Eq, Show)+  deriving stock (Eq, Show)  instance Semigroup ToggleStatus where   Pristine <> a = a@@ -134,7 +127,7 @@   NotFound   |   Ambiguous Int-  deriving (Eq, Show, Functor)+  deriving stock (Eq, Show, Functor)  instance Semigroup (ToggleResult a) where   NotFound <> a = a@@ -157,6 +150,12 @@     Success a >>= f = f a     NotFound >>= _ = NotFound     Ambiguous n >>= _ = Ambiguous n++toggleResultEither :: ToggleResult a -> Either Text a+toggleResultEither = \case+  Success a -> Right a+  NotFound -> Left "not found"+  Ambiguous n -> Left [exon|ambiguous: #{show n}|]  openPinnedSubs :: ToggleStatus -> ViewTree -> (ToggleStatus, ViewTree) openPinnedSubs Pristine t =
lib/Chiasma/View.hs view
@@ -1,17 +1,16 @@-{-# LANGUAGE RankNTypes #-}- module Chiasma.View where +import qualified Control.Lens as Lens+import Exon (exon)+import Prettyprinter (Doc, pretty)+import Prettyprinter.Render.Terminal (AnsiStyle)+ import Chiasma.Data.Ident (Ident, identText, sameIdent) import Chiasma.Data.TmuxId (PaneId, SessionId, WindowId)-import Chiasma.Data.View (View(View), viewIdent)-import Chiasma.Data.Views (Views, ViewsError(..))+import Chiasma.Data.View (View (View), viewIdent)+import Chiasma.Data.Views (Views, ViewsError (..)) import qualified Chiasma.Data.Views as Views (log, panes, sessions, windows) import Chiasma.Lens.Where (where1)-import Control.Lens (Lens', over)-import qualified Control.Lens as Lens (over, set, view)-import Data.Text.Prettyprint.Doc (Doc, pretty)-import Data.Text.Prettyprint.Doc.Render.Terminal (AnsiStyle)  sameId :: Eq a => a -> View a -> Bool sameId id' (View _ (Just vid)) = id' == vid@@ -26,11 +25,11 @@   find (sameId id') . Lens.view viewsL  insertView :: Lens' Views [View a] -> View a -> Views -> Views-insertView viewsL newView = Lens.over viewsL (newView :)+insertView viewsL newView = over viewsL (newView :)  updateView :: Lens' Views [View a] -> (Ident -> ViewsError) -> View a -> Views -> Views updateView viewsL _ newView =-  Lens.set (viewsL . where1 (sameIdent (viewIdent newView))) newView+  set (viewsL . where1 (sameIdent (viewIdent newView))) newView  session :: Ident -> Views -> Either ViewsError (View SessionId) session = view Views.sessions NoSuchSession@@ -78,26 +77,42 @@ type Getter a = Ident -> Views -> Either ViewsError (View a) type Setter a = View a -> Views -> Views -addView :: MonadDeepState s Views m => Setter a -> Ident -> m (View a)-addView setter ident = do-  modify $ setter newView-  viewsLogS $ "added tmux view " <> identText ident-  return newView-  where-    newView = View ident Nothing--findOrCreateView :: (MonadDeepState s Views m) => Getter a -> Setter a -> Ident -> m (View a)-findOrCreateView getter setter ident = do-  existing <- gets $ getter ident-  either (const $ addView setter ident) return existing--viewsLog :: MonadDeepState s Views m => Doc AnsiStyle -> m ()+viewsLog ::+  Member (AtomicState Views) r =>+  Doc AnsiStyle ->+  Sem r () viewsLog message =-  modify f+  atomicModify' f   where     f :: Views -> Views     f = over Views.log (message :) -viewsLogS :: MonadDeepState s Views m => Text -> m ()+viewsLogS ::+  Member (AtomicState Views) r =>+  Text ->+  Sem r () viewsLogS =   viewsLog . pretty++addView ::+  Member (AtomicState Views) r =>+  Setter a ->+  Ident ->+  Sem r (View a)+addView setter ident = do+  atomicModify' (setter newView)+  viewsLogS [exon|added tmux view #{identText ident}|]+  pure newView+  where+    newView =+      View ident Nothing++findOrCreateView ::+  Member (AtomicState Views) r =>+  Getter a ->+  Setter a ->+  Ident ->+  Sem r (View a)+findOrCreateView getter setter ident = do+  existing <- atomicGets (getter ident)+  either (const (addView setter ident)) pure existing
lib/Chiasma/View/State.hs view
@@ -2,16 +2,12 @@  import Chiasma.Data.Ident (Ident) import Chiasma.Data.TmuxId (PaneId)-import Control.Monad.DeepError (MonadDeepError, hoistEither)-import Control.Monad.DeepState (MonadDeepState, gets)- import Chiasma.Data.Views (Views, ViewsError) import qualified Chiasma.View as Views (paneId)  paneId ::-  (MonadDeepState s Views m, MonadDeepError e ViewsError m) =>+  Members [AtomicState Views, Stop ViewsError] r =>   Ident ->-  m PaneId-paneId paneIdent = do-  pid <- gets $ Views.paneId paneIdent-  hoistEither pid+  Sem r PaneId+paneId paneIdent =+  stopEither =<< atomicGets (Views.paneId paneIdent)
lib/Chiasma/Window.hs view
@@ -1,64 +1,66 @@ module Chiasma.Window where -import qualified Chiasma.Codec.Data as Codec (Pane(Pane, paneId), Window(Window, windowId))-import qualified Chiasma.Codec.Data.PaneDetail as Codec (PaneDetail(PaneDetail))-import qualified Chiasma.Codec.Data.PaneDetail as PaneDetail (PaneDetail(..))-import qualified Chiasma.Command.Pane as Cmd (closePane, firstWindowPane, windowPanesAs)-import qualified Chiasma.Command.Window as Cmd (newWindow, splitWindowAs, window)+import qualified Data.List.NonEmpty as NonEmpty (head, nonEmpty)+import Path (Abs, Dir, Path, parseAbsDir)+import Prettyprinter (line, pretty, vsep, (<+>))++import qualified Chiasma.Codec.Data.Pane as Pane+import qualified Chiasma.Codec.Data.Pane as Codec (Pane (Pane, paneId))+import Chiasma.Codec.Data.Pane (Pane (Pane))+import qualified Chiasma.Codec.Data.Window as Codec (Window (Window, windowId))+import qualified Chiasma.Command.Pane as Cmd (closePane, firstWindowPane, windowPanes)+import qualified Chiasma.Command.Window as Cmd (newWindow, splitWindowInDir, window)+import Chiasma.Data.Axis (Axis) import Chiasma.Data.Ident (Ident, identText, identify)-import Chiasma.Data.Maybe (findMaybe, maybeExcept, orElse)+import Chiasma.Data.Panes (TmuxPanes) import Chiasma.Data.RenderError (RenderError)-import qualified Chiasma.Data.RenderError as RenderError (RenderError(NoPrincipal))+import qualified Chiasma.Data.RenderError as RenderError (RenderError (NoPrincipal)) import Chiasma.Data.TmuxId (PaneId, SessionId, WindowId)-import Chiasma.Data.TmuxThunk (TmuxThunk)-import qualified Chiasma.Data.View as Tmux (View(View))+import qualified Chiasma.Data.View as Tmux (View (View)) import Chiasma.Data.Views (Views)-import Chiasma.Data.WindowState (WindowState(..))+import Chiasma.Data.WindowState (WindowState (..))+import Chiasma.Effect.TmuxApi (Tmux) import Chiasma.Pane (addPane) import Chiasma.Ui.Data.RenderableTree (-  RLayout(..),-  RPane(..),-  Renderable(..),+  RLayout (..),+  RPane (..),+  Renderable (..),   RenderableNode,   RenderableTree,   )-import qualified Chiasma.Ui.Data.Tree as Tree (Node(Sub, Leaf), Tree(Tree))-import Chiasma.Ui.Data.View (Tree(..), TreeSub(..), ViewTree, ViewTreeSub)-import qualified Chiasma.Ui.Data.View as Ui (Layout(..), Pane(Pane), PaneView, View(View))-import Chiasma.Ui.Data.ViewGeometry (ViewGeometry(ViewGeometry, position))+import qualified Chiasma.Ui.Data.Tree as Tree (Node (Leaf, Sub), Tree (Tree))+import Chiasma.Ui.Data.View (Tree (..), TreeSub (..), ViewTree, ViewTreeSub)+import qualified Chiasma.Ui.Data.View as Ui (Layout (..), Pane (Pane), PaneView, View (View))+import Chiasma.Ui.Data.ViewGeometry (ViewGeometry (ViewGeometry, position)) import Chiasma.Ui.Data.ViewState (ViewState) import Chiasma.View (findOrCreateView, viewsLog, viewsLogS) import qualified Chiasma.View as Views (insertPane, insertWindow, pane, paneById, updatePane, updateWindow, window)-import Control.Monad.Error.Class (MonadError)-import Control.Monad.Free.Class (MonadFree)-import qualified Data.List.NonEmpty as NonEmpty (head, nonEmpty)-import Data.Text.Prettyprint.Doc (line, pretty, vsep, (<+>))  findOrCreateWindow ::-  (MonadDeepState s Views m) =>+  Member (AtomicState Views) r =>   Ident ->-  m (Tmux.View WindowId)+  Sem r (Tmux.View WindowId) findOrCreateWindow =   findOrCreateView Views.window Views.insertWindow  registerWindowId ::-  (MonadDeepState s Views m) =>+  Member (AtomicState Views) r =>   Ident ->   WindowId ->-  m ()+  Sem r () registerWindowId ident windowId =-  modify $ Views.updateWindow $ Tmux.View ident (Just windowId)+  atomicModify' (Views.updateWindow (Tmux.View ident (Just windowId)))  spawnWindow ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>+  Members [AtomicState Views, Tmux] r =>   SessionId ->   Ident ->-  m Codec.Window+  Sem r Codec.Window spawnWindow sid ident = do   win@(Codec.Window windowId _ _) <- Cmd.newWindow sid ident   registerWindowId ident windowId   viewsLogS $ "spawned window in session " <> show sid <> " with id " <> show windowId-  return win+  pure win  findPrincipalSub :: ViewTreeSub -> Maybe Ui.PaneView findPrincipalSub (TreeNode t) = findPrincipal t@@ -67,109 +69,112 @@  findPrincipal :: ViewTree -> Maybe Ui.PaneView findPrincipal (Tree _ sub) =-  findMaybe findPrincipalSub sub+  firstJust findPrincipalSub sub  principalPane ::-  (MonadDeepState s Views m, MonadError RenderError m) =>+  Members [AtomicState Views, Tmux, Stop RenderError] r =>   ViewTree ->-  m (Ui.PaneView, Tmux.View PaneId)+  Sem r (Ui.PaneView, Tmux.View PaneId) principalPane tree = do-  uiPane@(Ui.View uiPaneIdent _ _ _) <- maybeExcept (RenderError.NoPrincipal $ identify tree) $ findPrincipal tree-  existingTmuxPane <- gets $ Views.pane uiPaneIdent-  tmuxPane <- either (const $ addPane uiPaneIdent) return existingTmuxPane-  return (uiPane, tmuxPane)+  uiPane@(Ui.View uiPaneIdent _ _ _) <- stopNote (RenderError.NoPrincipal (identify tree)) $ (findPrincipal tree)+  existingTmuxPane <- atomicGets (Views.pane uiPaneIdent)+  tmuxPane <- either (const $ addPane uiPaneIdent) pure existingTmuxPane+  pure (uiPane, tmuxPane)  syncPrincipal ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m, MonadError RenderError m) =>+  Members [TmuxPanes Pane, AtomicState Views, Tmux, Stop RenderError] r =>   WindowId ->   ViewTree ->-  m ()+  Sem r () syncPrincipal windowId tree@(Tree (Ui.View layoutIdent _ _ _) _) = do-  (Codec.Pane paneId _ _) <- Cmd.firstWindowPane windowId-  existing <- gets (Views.paneById paneId)+  (Codec.Pane paneId _ _ _ _) <- Cmd.firstWindowPane windowId+  existing <- atomicGets (Views.paneById paneId)   case existing of     Nothing -> do       (_, Tmux.View paneIdent _) <- principalPane tree       viewsLog $ "setting principal of layout" <+> pretty layoutIdent <+> " to pane " <+> pretty paneIdent <+> "/" <+>         pretty paneId-      modify $ Views.updatePane (Tmux.View paneIdent (Just paneId))-    _ -> return ()+      atomicModify' $ Views.updatePane (Tmux.View paneIdent (Just paneId))+    _ -> pure ()  ensureWindow ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m, MonadError RenderError m) =>+  Members [TmuxPanes Pane, AtomicState Views, Tmux, Stop RenderError] r =>   SessionId ->   Tmux.View WindowId ->   Maybe WindowId ->   ViewTree ->-  m Codec.Window+  Sem r Codec.Window ensureWindow sid (Tmux.View ident mayWid) newSessionWid tree = do-  preexisting <- join <$> traverse Cmd.window (orElse newSessionWid mayWid)-  window <- maybe (spawnWindow sid ident) return preexisting+  preexisting <- join <$> traverse Cmd.window (newSessionWid <|> mayWid)+  window <- maybe (spawnWindow sid ident) pure preexisting   syncPrincipal (Codec.windowId window) tree-  return window+  pure window -findOrCreatePane :: MonadDeepState s Views m => Ident -> m (Tmux.View PaneId)+findOrCreatePane ::+  Member (AtomicState Views) r =>+  Ident ->+  Sem r (Tmux.View PaneId) findOrCreatePane =   findOrCreateView Views.pane Views.insertPane  nativePane ::-  MonadFree TmuxThunk m =>+  Member (TmuxPanes Pane) r =>   WindowId ->   Tmux.View PaneId ->-  m (Maybe Codec.PaneDetail)+  Sem r (Maybe Pane) nativePane windowId (Tmux.View _ (Just paneId)) =-  find sameId <$> Cmd.windowPanesAs windowId+  find sameId <$> Cmd.windowPanes windowId   where-    sameId (Codec.PaneDetail i _ _ _ _) = i == paneId-nativePane _ _ = return Nothing+    sameId (Pane i _ _ _ _) = i == paneId+nativePane _ _ = pure Nothing  openPane ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>-  FilePath ->+  Members [AtomicState Views, Tmux] r =>+  Path Abs Dir ->   WindowId ->-  m Codec.PaneDetail+  Sem r Pane openPane dir windowId = do-  detail <- Cmd.splitWindowAs dir windowId-  viewsLogS $ "opened pane " <> show (PaneDetail.paneId detail) <> " in window " <> show windowId-  return detail+  detail <- Cmd.splitWindowInDir dir windowId+  viewsLogS $ "opened pane " <> show (Pane.paneId detail) <> " in window " <> show windowId+  pure detail  ensurePaneOpen ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>-  FilePath ->-  Maybe Codec.PaneDetail ->+  Members [AtomicState Views, Tmux] r =>+  Path Abs Dir ->+  Maybe Pane ->   WindowId ->-  m Codec.PaneDetail+  Sem r Pane ensurePaneOpen _ (Just detail) _ =-  return detail+  pure detail ensurePaneOpen dir Nothing windowId =   openPane dir windowId  ensurePaneClosed ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>-  Maybe Codec.PaneDetail ->-  m ()-ensurePaneClosed (Just (Codec.PaneDetail i _ _ _ _)) = do+  Members [AtomicState Views, Tmux] r =>+  Maybe Pane ->+  Sem r ()+ensurePaneClosed (Just (Pane i _ _ _ _)) = do   viewsLogS $ "closing pane " <> show i   Cmd.closePane i-ensurePaneClosed _ = return ()+ensurePaneClosed _ = pure ()  ensurePane ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>-  FilePath ->+  Members [TmuxPanes Pane, AtomicState Views, Tmux] r =>+  Path Abs Dir ->   WindowId ->   Ui.PaneView ->-  m (Maybe RenderableNode)+  Sem r (Maybe RenderableNode) ensurePane cwd windowId (Ui.View paneIdent vState geometry (Ui.Pane open _ customDir)) = do   tmuxPane <- findOrCreatePane paneIdent   existingPane <- nativePane windowId tmuxPane   updatedPane <-     if open then Just <$> ensurePaneOpen dir existingPane windowId     else Nothing <$ ensurePaneClosed existingPane-  modify $ Views.updatePane (Tmux.View paneIdent (PaneDetail.paneId <$> updatedPane))-  return $ cons <$> updatedPane+  atomicModify' $ Views.updatePane (Tmux.View paneIdent (Pane.paneId <$> updatedPane))+  pure $ cons <$> updatedPane   where-    dir = fromMaybe cwd customDir-    cons (Codec.PaneDetail i _ _ top left) =+    dir = fromMaybe cwd (parseAbsDir . toString =<< customDir)+    cons (Pane i _ _ top left) =       Tree.Leaf . Renderable vState geometry $ RPane i top left  refPane :: RenderableNode -> RPane@@ -179,12 +184,12 @@ renderableTree ::   ViewState ->   ViewGeometry ->-  Bool ->+  Axis ->   [RenderableNode] ->   Maybe RenderableTree-renderableTree vState geometry vertical sub = do+renderableTree vState geometry axis sub = do   sub' <- NonEmpty.nonEmpty sub-  return $ Tree.Tree (Renderable vState geometry (RLayout (refPane $ NonEmpty.head sub') vertical)) sub'+  pure $ Tree.Tree (Renderable vState geometry (RLayout (refPane $ NonEmpty.head sub') axis)) sub'  viewPosition :: ViewTreeSub -> Float viewPosition (TreeNode (Tree (Ui.View _ _ ViewGeometry { position = pos } _) _)) =@@ -193,33 +198,33 @@   fromMaybe 0.5 pos  ensureView ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>-  FilePath ->+  Members [TmuxPanes Pane, AtomicState Views, Tmux] r =>+  Path Abs Dir ->   WindowId ->   ViewTree ->-  m (Maybe RenderableTree)+  Sem r (Maybe RenderableTree) ensureView cwd windowId =   ensureTree   where-    ensureTree (Tree (Ui.View layoutIdent vState geometry (Ui.Layout vertical)) sub) = do+    ensureTree (Tree (Ui.View layoutIdent vState geometry (Ui.Layout axis)) sub) = do       ensuredSub <- traverse ensureNode sortedSub       viewsLog $ pretty ("new sub for layout `" <> identText layoutIdent <> "`:") <> line <>         vsep (pretty <$> ensuredSub)-      return $ renderableTree vState geometry vertical $ catMaybes ensuredSub+      pure $ renderableTree vState geometry axis $ catMaybes ensuredSub       where         sortedSub = sortOn viewPosition sub     ensureNode (TreeNode t) = do       newTree <- ensureTree t-      return $ Tree.Sub <$> newTree+      pure $ Tree.Sub <$> newTree     ensureNode (TreeLeaf v) =       ensurePane cwd windowId v  windowState ::-  (MonadDeepState s Views m, MonadFree TmuxThunk m) =>+  Member (TmuxPanes Pane) r =>   Ident ->   Codec.Window ->   RenderableTree ->-  m WindowState+  Sem r WindowState windowState windowIdent window tree = do   nativeRef <- Cmd.firstWindowPane (Codec.windowId window)-  return $ WindowState window nativeRef windowIdent tree (Codec.paneId nativeRef)+  pure $ WindowState window nativeRef windowIdent tree (Codec.paneId nativeRef)
− lib/Prelude.hs
@@ -1,5 +0,0 @@-module Prelude (-  module Chiasma.Prelude,-) where--import Chiasma.Prelude
− readme.md
@@ -1,3 +0,0 @@-# Intro--**chiasma** is a tmux api client for Haskell.
− test/Chiasma/Test/CodecTest.hs
@@ -1,24 +0,0 @@-module Chiasma.Test.CodecTest where--import Chiasma.Codec (TmuxCodec(decode, query), TmuxQuery(TmuxQuery))-import Chiasma.Data.TmuxId (PaneId(..), WindowId(..))-import Hedgehog ((===))--import Chiasma.Test.Util (UnitTest)--data Dat =-  Dat {-    paneId :: PaneId,-    windowId :: WindowId-  }-  deriving (Eq, Show, Generic)--instance TmuxCodec Dat--test_decode :: UnitTest-test_decode =-  Right (Dat (PaneId 1) (WindowId 2)) === decode " %1 @2 "--test_query :: UnitTest-test_query =-  TmuxQuery "#{pane_id} #{window_id}" === query @Dat
− test/Chiasma/Test/LensTest.hs
@@ -1,102 +0,0 @@-module Chiasma.Test.LensTest where--import Chiasma.Data.Ident (Ident(Str))-import Chiasma.Lens.Tree (leafByIdent, modifyLeafByIdent, treesAndSubs)-import Chiasma.Ui.Data.View (-  Pane(Pane),-  PaneView,-  Tree(Tree),-  TreeSub(TreeNode, TreeLeaf),-  View(View),-  ViewTree,-  ViewTreeSub,-  consLayout,-  consPane,-  )-import qualified Chiasma.Ui.Data.View as View (_ident, ident)-import Chiasma.Ui.Data.ViewState (ViewState(ViewState))-import Chiasma.Ui.ViewTree (togglePane)-import qualified Chiasma.Ui.ViewTree as ToggleResult (ToggleResult(..))-import Control.Lens (transformM)-import qualified Control.Lens as Lens (set)-import Hedgehog ((===))-import Test.Tasty (TestTree, testGroup)-import Chiasma.Test.Util (UnitTest, unitTest)--id0, id1, id2, id3, id4 :: Ident-id0 = Str "0"-id1 = Str "1"-id2 = Str "2"-id3 = Str "3"-id4 = Str "4"--tree :: ViewTree-tree =-  Tree (consLayout id0) [subtree, TreeLeaf (consPane id2)]-  where-    subtree = st id2 subtree2-    subtree2 = st id3 subtree3-    subtree3 = st id4 (TreeLeaf openPane)-    openPane = View id1 (ViewState False) def (Pane True False Nothing)-    st i s =-      TreeNode $ Tree (consLayout i) [s]--test_modify :: UnitTest-test_modify = do-  let-    ident = Str "changed"-    modded = modifyLeafByIdent id1 (Lens.set View.ident ident) tree-  Nothing === leafByIdent ident tree-  Just ident === (View._ident <$> leafByIdent ident modded)--failOnPaneIdent :: Ident -> ViewTree -> Maybe ViewTree-failOnPaneIdent target t@(Tree _ sub) =-  t <$ traverse match sub-  where-    match (TreeLeaf (View i _ _ _)) = if target == i then Nothing else Just ()-    match _ = Just ()--test_monadicModify :: UnitTest-test_monadicModify = do-  Nothing === (transformM (failOnPaneIdent id2) tree)-  Just tree === (transformM (failOnPaneIdent id4) tree)--insertPane :: Ident -> PaneView -> ViewTree -> ViewTree-insertPane targetLayout pane (Tree l sub) =-  if View._ident l == targetLayout then Tree l (TreeLeaf pane : sub) else Tree l sub--ensurePaneUnique :: Ident -> ViewTreeSub -> Maybe ViewTreeSub-ensurePaneUnique paneIdent (TreeLeaf (View ident _ _ _)) | ident == paneIdent = Nothing-ensurePaneUnique _ n = Just n--subtreesTarget :: ViewTree-subtreesTarget =-  Tree (consLayout id0) [subtree, TreeLeaf (consPane id2)]-  where-    subtree = TreeNode $ Tree (consLayout id2) [TreeLeaf $ consPane id4, subtree2]-    subtree2 = TreeNode $ Tree (consLayout id3) [subtree3]-    subtree3 = TreeNode $ Tree (consLayout id4) [TreeLeaf openPane]-    openPane = View id1 (ViewState False) def (Pane True False Nothing)--test_subtrees :: UnitTest-test_subtrees =-  Just subtreesTarget === treesAndSubs (Just . insertPane id2 (consPane id4)) (ensurePaneUnique id4) tree--togglePaneTree :: ViewTree-togglePaneTree =-  Tree (consLayout id0) [TreeLeaf (consPane id0), TreeLeaf (consPane id0), TreeLeaf (consPane id2)]--test_togglePane :: UnitTest-test_togglePane = do-  ToggleResult.Ambiguous 2 === togglePane id0 togglePaneTree-  ToggleResult.NotFound === togglePane id1 togglePaneTree-  ToggleResult.Success (1 :: Int) === (1 <$ togglePane id2 togglePaneTree)--test_lenses :: TestTree-test_lenses =-  testGroup "lenses" [-    unitTest "modify leaves by ident" test_modify,-    unitTest "monadically transform leaves" test_monadicModify,-    unitTest "traverse all subtrees" test_subtrees,-    unitTest "toggle a pane" test_togglePane-  ]
− test/Chiasma/Test/OutputParseTest.hs
@@ -1,29 +0,0 @@-module Chiasma.Test.OutputParseTest where--import Chiasma.Native.Parse (resultLines)-import qualified Data.Text as T (unlines)-import Hedgehog ((===))--import Chiasma.Test.Util (UnitTest)--paneLine :: Text-paneLine = "%0 100 100"--tmuxOutput :: Text-tmuxOutput = T.unlines [-  "%begin 123",-  "%end 123",-  "%session-changed $0 0",-  "%begin 234",-  paneLine,-  "b",-  "%end 234",-  "%begin 345",-  "c",-  "d",-  "%end 345"-  ]--test_outputParse :: UnitTest-test_outputParse =-  Right [[], [paneLine, "b"], ["c", "d"]] === resultLines tmuxOutput
− test/Chiasma/Test/PinTest.hs
@@ -1,98 +0,0 @@-module Chiasma.Test.PinTest where--import Chiasma.Data.Ident (Ident(Str))-import Chiasma.Ui.Data.View (-  Pane(Pane),-  Tree(Tree),-  TreeSub(TreeNode, TreeLeaf),-  View(View),-  ViewTree,-  ViewTreeSub,-  consLayout,-  )-import Chiasma.Ui.ViewTree (toggleLayout, togglePane)-import qualified Chiasma.Ui.ViewTree as ToggleResult (ToggleResult(..))-import Hedgehog ((===))-import Test.Tasty (TestTree, testGroup)--import Chiasma.Test.Util (UnitTest, unitTest)--node :: ViewTreeSub -> View Pane -> ViewTreeSub-node sub p =-  TreeNode $ Tree (consLayout "l") [sub, TreeLeaf p]--paneWith :: Bool -> Text -> ViewTreeSub-paneWith open i = TreeLeaf $ View (Str i) def def (Pane open False Nothing)--pane :: Text -> ViewTreeSub-pane =-  paneWith False--ppaneWithIdent :: Text -> Bool -> View Pane-ppaneWithIdent name open =-  View (Str name) def def (Pane open True Nothing)--ppaneWith :: Bool -> View Pane-ppaneWith =-  ppaneWithIdent "pin"--ppane :: View Pane-ppane =-  ppaneWith False--subtree4 :: ViewTreeSub-subtree4 = node subtree5 ppane--subtree5 :: ViewTreeSub-subtree5 = node subtree6 ppane--subtree6 :: ViewTreeSub-subtree6 = TreeNode $ Tree (consLayout (Str "l")) [pane "p2"]--tree :: ViewTree-tree =-  Tree (consLayout (Str "root")) [subtree4, subtree1, subtree4]-  where-    subtree1 = node subtree2 ppane-    subtree2 = node subtree3 ppane-    subtree3 = TreeNode $ Tree (consLayout (Str "l1")) [pane "p1"]--target :: ViewTree-target =-  Tree (consLayout (Str "root")) [subtree4, subtree1, subtree4]-  where-    subtree1 = node subtree2 (ppaneWith True)-    subtree2 = node subtree3 (ppaneWith True)-    subtree3 = TreeNode $ Tree (consLayout (Str "l1")) [TreeLeaf $ View (Str "p1") def def (Pane True False Nothing)]--test_pinOpenNonpinned :: UnitTest-test_pinOpenNonpinned =-  ToggleResult.Success target === togglePane (Str "p1") tree--test_layoutPinOpenNonpinned :: UnitTest-test_layoutPinOpenNonpinned =-  ToggleResult.Success target === toggleLayout (Str "l1") tree--pinnedTree :: ViewTree-pinnedTree =-  Tree (consLayout (Str "root")) [pane "left", subtree]-  where-    subtree = TreeNode $ Tree (consLayout (Str "l1")) [pane "p2", TreeLeaf $ ppaneWithIdent "p1" False]--pinnedTarget :: ViewTree-pinnedTarget =-  Tree (consLayout (Str "root")) [pane "left", subtree]-  where-    subtree = TreeNode $ Tree (consLayout (Str "l1")) [paneWith False "p2", TreeLeaf $ ppaneWithIdent "p1" True]--test_pinOpenPinned :: UnitTest-test_pinOpenPinned =-  ToggleResult.Success pinnedTarget === toggleLayout (Str "l1") pinnedTree--test_pin :: TestTree-test_pin =-  testGroup "pin" [-    unitTest "open an unpinned pane" test_pinOpenNonpinned,-    unitTest "open an unpinned layout" test_layoutPinOpenNonpinned,-    unitTest "open a pinned pane" test_pinOpenPinned-  ]
− test/Chiasma/Test/StreamParseTest.hs
@@ -1,30 +0,0 @@-module Chiasma.Test.StreamParseTest where--import Chiasma.Native.StreamParse (TmuxOutputBlock(Success), parseConduit)-import Conduit-import Data.ByteString.Internal (packChars)-import Data.Conduit.List-import qualified Data.Text as T (unpack)-import Hedgehog ((===))--import Chiasma.Test.Util (UnitTest)--paneLine :: Text-paneLine = "%0 100 100"--tmuxOutput :: [Text]-tmuxOutput = [-  "%begin 123\n",-  "%end 123\n",-  "%session-changed $0 0\n%begin 234\n",-  paneLine <> "\nb\n%end 234\n",-  "%begin 345\n",-  "c\n",-  "d\n",-  "%end 345\n"-  ]--test_streamParse :: UnitTest-test_streamParse = do-  r <- runConduit $ sourceList tmuxOutput .| mapC (packChars . T.unpack) .| parseConduit .| sinkList-  [Success [], Success [paneLine, "b"], Success ["c", "d"]] === r
− test/Chiasma/Test/Util.hs
@@ -1,14 +0,0 @@-module Chiasma.Test.Util where--import Hedgehog (TestT, withTests, property, test)-import Test.Tasty (TestName, TestTree)-import Test.Tasty.Hedgehog (testProperty)--type UnitTest = TestT IO ()--unitTest ::-  TestName ->-  UnitTest ->-  TestTree-unitTest desc =-  testProperty desc . withTests 1 . property . test
− test/Main.hs
@@ -1,24 +0,0 @@-module Main where--import Chiasma.Test.CodecTest (test_decode, test_query)-import Chiasma.Test.LensTest (test_lenses)-import Chiasma.Test.OutputParseTest (test_outputParse)-import Chiasma.Test.PinTest (test_pin)-import Chiasma.Test.StreamParseTest (test_streamParse)-import Chiasma.Test.Util (unitTest)-import Test.Tasty (TestTree, defaultMain, testGroup)--tests :: TestTree-tests =-  testGroup "all" [-    unitTest "tmux-decode a value" test_decode,-    unitTest "tmux-encode a query" test_query,-    test_lenses,-    unitTest "parse tmux output" test_outputParse,-    test_pin,-    unitTest "parse tmux output in stream" test_streamParse-  ]--main :: IO ()-main =-  defaultMain tests