-- |The ID type used to store active scratch buffers.
module Ribosome.Data.ScratchId where

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

-- |The ID type used to store active scratch buffers.
newtype ScratchId =
  ScratchId { ScratchId -> Text
unScratchId :: Text }
  deriving stock (ScratchId -> ScratchId -> Bool
(ScratchId -> ScratchId -> Bool)
-> (ScratchId -> ScratchId -> Bool) -> Eq ScratchId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScratchId -> ScratchId -> Bool
$c/= :: ScratchId -> ScratchId -> Bool
== :: ScratchId -> ScratchId -> Bool
$c== :: ScratchId -> ScratchId -> Bool
Eq, Int -> ScratchId -> ShowS
[ScratchId] -> ShowS
ScratchId -> String
(Int -> ScratchId -> ShowS)
-> (ScratchId -> String)
-> ([ScratchId] -> ShowS)
-> Show ScratchId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScratchId] -> ShowS
$cshowList :: [ScratchId] -> ShowS
show :: ScratchId -> String
$cshow :: ScratchId -> String
showsPrec :: Int -> ScratchId -> ShowS
$cshowsPrec :: Int -> ScratchId -> ShowS
Show)
  deriving newtype (String -> ScratchId
(String -> ScratchId) -> IsString ScratchId
forall a. (String -> a) -> IsString a
fromString :: String -> ScratchId
$cfromString :: String -> ScratchId
IsString, Eq ScratchId
Eq ScratchId
-> (ScratchId -> ScratchId -> Ordering)
-> (ScratchId -> ScratchId -> Bool)
-> (ScratchId -> ScratchId -> Bool)
-> (ScratchId -> ScratchId -> Bool)
-> (ScratchId -> ScratchId -> Bool)
-> (ScratchId -> ScratchId -> ScratchId)
-> (ScratchId -> ScratchId -> ScratchId)
-> Ord ScratchId
ScratchId -> ScratchId -> Bool
ScratchId -> ScratchId -> Ordering
ScratchId -> ScratchId -> ScratchId
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ScratchId -> ScratchId -> ScratchId
$cmin :: ScratchId -> ScratchId -> ScratchId
max :: ScratchId -> ScratchId -> ScratchId
$cmax :: ScratchId -> ScratchId -> ScratchId
>= :: ScratchId -> ScratchId -> Bool
$c>= :: ScratchId -> ScratchId -> Bool
> :: ScratchId -> ScratchId -> Bool
$c> :: ScratchId -> ScratchId -> Bool
<= :: ScratchId -> ScratchId -> Bool
$c<= :: ScratchId -> ScratchId -> Bool
< :: ScratchId -> ScratchId -> Bool
$c< :: ScratchId -> ScratchId -> Bool
compare :: ScratchId -> ScratchId -> Ordering
$ccompare :: ScratchId -> ScratchId -> Ordering
Ord, Object -> Either DecodeError ScratchId
(Object -> Either DecodeError ScratchId) -> MsgpackDecode ScratchId
forall a. (Object -> Either DecodeError a) -> MsgpackDecode a
fromMsgpack :: Object -> Either DecodeError ScratchId
$cfromMsgpack :: Object -> Either DecodeError ScratchId
MsgpackDecode, ScratchId -> Object
(ScratchId -> Object) -> MsgpackEncode ScratchId
forall a. (a -> Object) -> MsgpackEncode a
toMsgpack :: ScratchId -> Object
$ctoMsgpack :: ScratchId -> Object
MsgpackEncode)