-- |Codec data type for the result type of @nvim_get_mode@.
module Ribosome.Data.Mode where

import Ribosome.Host.Class.Msgpack.Decode (MsgpackDecode)
import Ribosome.Host.Class.Msgpack.Encode (MsgpackEncode)

-- |Codec data type for the result type of @nvim_get_mode@.
data NvimMode =
  NvimMode {
    NvimMode -> Text
mode :: Text,
    NvimMode -> Bool
blocking :: Bool
  }
  deriving stock (NvimMode -> NvimMode -> Bool
(NvimMode -> NvimMode -> Bool)
-> (NvimMode -> NvimMode -> Bool) -> Eq NvimMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NvimMode -> NvimMode -> Bool
$c/= :: NvimMode -> NvimMode -> Bool
== :: NvimMode -> NvimMode -> Bool
$c== :: NvimMode -> NvimMode -> Bool
Eq, Int -> NvimMode -> ShowS
[NvimMode] -> ShowS
NvimMode -> String
(Int -> NvimMode -> ShowS)
-> (NvimMode -> String) -> ([NvimMode] -> ShowS) -> Show NvimMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NvimMode] -> ShowS
$cshowList :: [NvimMode] -> ShowS
show :: NvimMode -> String
$cshow :: NvimMode -> String
showsPrec :: Int -> NvimMode -> ShowS
$cshowsPrec :: Int -> NvimMode -> ShowS
Show, (forall x. NvimMode -> Rep NvimMode x)
-> (forall x. Rep NvimMode x -> NvimMode) -> Generic NvimMode
forall x. Rep NvimMode x -> NvimMode
forall x. NvimMode -> Rep NvimMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NvimMode x -> NvimMode
$cfrom :: forall x. NvimMode -> Rep NvimMode x
Generic)
  deriving anyclass (NvimMode -> Object
(NvimMode -> Object) -> MsgpackEncode NvimMode
forall a. (a -> Object) -> MsgpackEncode a
toMsgpack :: NvimMode -> Object
$ctoMsgpack :: NvimMode -> Object
MsgpackEncode, Object -> Either DecodeError NvimMode
(Object -> Either DecodeError NvimMode) -> MsgpackDecode NvimMode
forall a. (Object -> Either DecodeError a) -> MsgpackDecode a
fromMsgpack :: Object -> Either DecodeError NvimMode
$cfromMsgpack :: Object -> Either DecodeError NvimMode
MsgpackDecode)