module Polysemy.Hasql.Queue.Data.Queue where

import Prelude hiding (Queue)

type family InputConn (queue :: Symbol) :: Symbol where
  InputConn queue =
    AppendSymbol queue "-input"

type family OutputConn (queue :: Symbol) :: Symbol where
  OutputConn queue =
    AppendSymbol queue "-output"

type family Queue (queue :: Symbol) t :: Constraint where
  Queue queue t =
    (
      Ord t,
      KnownSymbol queue,
      KnownSymbol (InputConn queue),
      KnownSymbol (OutputConn queue)
    )

type family QueueInput (queue :: Symbol) t :: Constraint where
  QueueInput queue t =
    (Ord t, KnownSymbol (InputConn queue))

type family QueueOutput (queue :: Symbol) t :: Constraint where
  QueueOutput queue t =
    (Ord t, KnownSymbol (OutputConn queue))

newtype QueueName =
  QueueName { QueueName -> Text
unQueueName :: Text }
  deriving stock (QueueName -> QueueName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueName -> QueueName -> Bool
$c/= :: QueueName -> QueueName -> Bool
== :: QueueName -> QueueName -> Bool
$c== :: QueueName -> QueueName -> Bool
Eq, Int -> QueueName -> ShowS
[QueueName] -> ShowS
QueueName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueueName] -> ShowS
$cshowList :: [QueueName] -> ShowS
show :: QueueName -> String
$cshow :: QueueName -> String
showsPrec :: Int -> QueueName -> ShowS
$cshowsPrec :: Int -> QueueName -> ShowS
Show, forall x. Rep QueueName x -> QueueName
forall x. QueueName -> Rep QueueName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QueueName x -> QueueName
$cfrom :: forall x. QueueName -> Rep QueueName x
Generic)
  deriving newtype (String -> QueueName
forall a. (String -> a) -> IsString a
fromString :: String -> QueueName
$cfromString :: String -> QueueName
IsString, Eq QueueName
QueueName -> QueueName -> Bool
QueueName -> QueueName -> Ordering
QueueName -> QueueName -> QueueName
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 :: QueueName -> QueueName -> QueueName
$cmin :: QueueName -> QueueName -> QueueName
max :: QueueName -> QueueName -> QueueName
$cmax :: QueueName -> QueueName -> QueueName
>= :: QueueName -> QueueName -> Bool
$c>= :: QueueName -> QueueName -> Bool
> :: QueueName -> QueueName -> Bool
$c> :: QueueName -> QueueName -> Bool
<= :: QueueName -> QueueName -> Bool
$c<= :: QueueName -> QueueName -> Bool
< :: QueueName -> QueueName -> Bool
$c< :: QueueName -> QueueName -> Bool
compare :: QueueName -> QueueName -> Ordering
$ccompare :: QueueName -> QueueName -> Ordering
Ord)