-- | @since 0.1
module Effectful.Environment.Utils
  ( QueryExePath (..),
  )
where

import Control.DeepSeq (NFData)
import GHC.Generics (Generic)

-- | Result of querying for the executable path.
--
-- @since 0.1
data QueryExePath
  = -- | If the system does not provide a reliable way to determine the
    -- current executable.
    --
    -- @since 0.1
    NoQuery
  | -- | The result of querying the executable name.
    --
    -- @since 0.1
    QueryResult (Maybe FilePath)
  deriving stock
    ( -- | @since 0.1
      QueryExePath -> QueryExePath -> Bool
(QueryExePath -> QueryExePath -> Bool)
-> (QueryExePath -> QueryExePath -> Bool) -> Eq QueryExePath
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryExePath -> QueryExePath -> Bool
== :: QueryExePath -> QueryExePath -> Bool
$c/= :: QueryExePath -> QueryExePath -> Bool
/= :: QueryExePath -> QueryExePath -> Bool
Eq,
      -- | @since 0.1
      (forall x. QueryExePath -> Rep QueryExePath x)
-> (forall x. Rep QueryExePath x -> QueryExePath)
-> Generic QueryExePath
forall x. Rep QueryExePath x -> QueryExePath
forall x. QueryExePath -> Rep QueryExePath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. QueryExePath -> Rep QueryExePath x
from :: forall x. QueryExePath -> Rep QueryExePath x
$cto :: forall x. Rep QueryExePath x -> QueryExePath
to :: forall x. Rep QueryExePath x -> QueryExePath
Generic,
      -- | @since 0.1
      Eq QueryExePath
Eq QueryExePath =>
(QueryExePath -> QueryExePath -> Ordering)
-> (QueryExePath -> QueryExePath -> Bool)
-> (QueryExePath -> QueryExePath -> Bool)
-> (QueryExePath -> QueryExePath -> Bool)
-> (QueryExePath -> QueryExePath -> Bool)
-> (QueryExePath -> QueryExePath -> QueryExePath)
-> (QueryExePath -> QueryExePath -> QueryExePath)
-> Ord QueryExePath
QueryExePath -> QueryExePath -> Bool
QueryExePath -> QueryExePath -> Ordering
QueryExePath -> QueryExePath -> QueryExePath
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
$ccompare :: QueryExePath -> QueryExePath -> Ordering
compare :: QueryExePath -> QueryExePath -> Ordering
$c< :: QueryExePath -> QueryExePath -> Bool
< :: QueryExePath -> QueryExePath -> Bool
$c<= :: QueryExePath -> QueryExePath -> Bool
<= :: QueryExePath -> QueryExePath -> Bool
$c> :: QueryExePath -> QueryExePath -> Bool
> :: QueryExePath -> QueryExePath -> Bool
$c>= :: QueryExePath -> QueryExePath -> Bool
>= :: QueryExePath -> QueryExePath -> Bool
$cmax :: QueryExePath -> QueryExePath -> QueryExePath
max :: QueryExePath -> QueryExePath -> QueryExePath
$cmin :: QueryExePath -> QueryExePath -> QueryExePath
min :: QueryExePath -> QueryExePath -> QueryExePath
Ord,
      -- | @since 0.1
      Int -> QueryExePath -> ShowS
[QueryExePath] -> ShowS
QueryExePath -> FilePath
(Int -> QueryExePath -> ShowS)
-> (QueryExePath -> FilePath)
-> ([QueryExePath] -> ShowS)
-> Show QueryExePath
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryExePath -> ShowS
showsPrec :: Int -> QueryExePath -> ShowS
$cshow :: QueryExePath -> FilePath
show :: QueryExePath -> FilePath
$cshowList :: [QueryExePath] -> ShowS
showList :: [QueryExePath] -> ShowS
Show
    )
  deriving anyclass
    ( -- | @since 0.1
      QueryExePath -> ()
(QueryExePath -> ()) -> NFData QueryExePath
forall a. (a -> ()) -> NFData a
$crnf :: QueryExePath -> ()
rnf :: QueryExePath -> ()
NFData
    )