{-# LANGUAGE UndecidableInstances #-}

-- | Supplies PathSize 'Config'.
--
-- @since 0.1
module PathSize.Data.Config
  ( -- * Config
    Config (..),
    defaultConfig,

    -- * Strategy
    Strategy (..),
    _Sync,
    _Async,
    _AsyncPool,

    -- * Constants
    defaultNumPaths,
    defaultNumPathsSize,
  )
where

import Data.HashSet (HashSet)
import Data.HashSet qualified as HSet
import Data.Word (Word16)
import Effects.FileSystem.OsPath (OsPath)
import Numeric.Data.Positive.Internal (Positive (UnsafePositive))
import Optics.Core
  ( A_Lens,
    LabelOptic (labelOptic),
    Prism',
    lensVL,
    prism,
  )

-- | Describes the path search strategy.
--
-- @since 0.1
data Strategy
  = -- | No threads.
    --
    -- @since 0.1
    Sync
  | -- | Lightweight threads.
    --
    -- @since 0.1
    Async
  | -- | Uses a thread pool.
    --
    -- @since 0.1
    AsyncPool
  deriving stock
    ( -- | @since 0.1
      Strategy
Strategy -> Strategy -> Bounded Strategy
forall a. a -> a -> Bounded a
$cminBound :: Strategy
minBound :: Strategy
$cmaxBound :: Strategy
maxBound :: Strategy
Bounded,
      -- | @since 0.1
      Strategy -> Strategy -> Bool
(Strategy -> Strategy -> Bool)
-> (Strategy -> Strategy -> Bool) -> Eq Strategy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Strategy -> Strategy -> Bool
== :: Strategy -> Strategy -> Bool
$c/= :: Strategy -> Strategy -> Bool
/= :: Strategy -> Strategy -> Bool
Eq,
      -- | @since 0.1
      Int -> Strategy
Strategy -> Int
Strategy -> [Strategy]
Strategy -> Strategy
Strategy -> Strategy -> [Strategy]
Strategy -> Strategy -> Strategy -> [Strategy]
(Strategy -> Strategy)
-> (Strategy -> Strategy)
-> (Int -> Strategy)
-> (Strategy -> Int)
-> (Strategy -> [Strategy])
-> (Strategy -> Strategy -> [Strategy])
-> (Strategy -> Strategy -> [Strategy])
-> (Strategy -> Strategy -> Strategy -> [Strategy])
-> Enum Strategy
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Strategy -> Strategy
succ :: Strategy -> Strategy
$cpred :: Strategy -> Strategy
pred :: Strategy -> Strategy
$ctoEnum :: Int -> Strategy
toEnum :: Int -> Strategy
$cfromEnum :: Strategy -> Int
fromEnum :: Strategy -> Int
$cenumFrom :: Strategy -> [Strategy]
enumFrom :: Strategy -> [Strategy]
$cenumFromThen :: Strategy -> Strategy -> [Strategy]
enumFromThen :: Strategy -> Strategy -> [Strategy]
$cenumFromTo :: Strategy -> Strategy -> [Strategy]
enumFromTo :: Strategy -> Strategy -> [Strategy]
$cenumFromThenTo :: Strategy -> Strategy -> Strategy -> [Strategy]
enumFromThenTo :: Strategy -> Strategy -> Strategy -> [Strategy]
Enum,
      -- | @since 0.1
      Eq Strategy
Eq Strategy =>
(Strategy -> Strategy -> Ordering)
-> (Strategy -> Strategy -> Bool)
-> (Strategy -> Strategy -> Bool)
-> (Strategy -> Strategy -> Bool)
-> (Strategy -> Strategy -> Bool)
-> (Strategy -> Strategy -> Strategy)
-> (Strategy -> Strategy -> Strategy)
-> Ord Strategy
Strategy -> Strategy -> Bool
Strategy -> Strategy -> Ordering
Strategy -> Strategy -> Strategy
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 :: Strategy -> Strategy -> Ordering
compare :: Strategy -> Strategy -> Ordering
$c< :: Strategy -> Strategy -> Bool
< :: Strategy -> Strategy -> Bool
$c<= :: Strategy -> Strategy -> Bool
<= :: Strategy -> Strategy -> Bool
$c> :: Strategy -> Strategy -> Bool
> :: Strategy -> Strategy -> Bool
$c>= :: Strategy -> Strategy -> Bool
>= :: Strategy -> Strategy -> Bool
$cmax :: Strategy -> Strategy -> Strategy
max :: Strategy -> Strategy -> Strategy
$cmin :: Strategy -> Strategy -> Strategy
min :: Strategy -> Strategy -> Strategy
Ord,
      -- | @since 0.1
      Int -> Strategy -> ShowS
[Strategy] -> ShowS
Strategy -> [Char]
(Int -> Strategy -> ShowS)
-> (Strategy -> [Char]) -> ([Strategy] -> ShowS) -> Show Strategy
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Strategy -> ShowS
showsPrec :: Int -> Strategy -> ShowS
$cshow :: Strategy -> [Char]
show :: Strategy -> [Char]
$cshowList :: [Strategy] -> ShowS
showList :: [Strategy] -> ShowS
Show
    )

-- | @since 0.1
_Sync :: Prism' Strategy ()
_Sync :: Prism' Strategy ()
_Sync =
  (() -> Strategy)
-> (Strategy -> Either Strategy ()) -> Prism' Strategy ()
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism
    (Strategy -> () -> Strategy
forall a b. a -> b -> a
const Strategy
Sync)
    ( \case
        Strategy
Sync -> () -> Either Strategy ()
forall a b. b -> Either a b
Right ()
        Strategy
x -> Strategy -> Either Strategy ()
forall a b. a -> Either a b
Left Strategy
x
    )
{-# INLINE _Sync #-}

-- | @since 0.1
_Async :: Prism' Strategy ()
_Async :: Prism' Strategy ()
_Async =
  (() -> Strategy)
-> (Strategy -> Either Strategy ()) -> Prism' Strategy ()
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism
    (Strategy -> () -> Strategy
forall a b. a -> b -> a
const Strategy
Async)
    ( \case
        Strategy
Async -> () -> Either Strategy ()
forall a b. b -> Either a b
Right ()
        Strategy
x -> Strategy -> Either Strategy ()
forall a b. a -> Either a b
Left Strategy
x
    )
{-# INLINE _Async #-}

-- | @since 0.1
_AsyncPool :: Prism' Strategy ()
_AsyncPool :: Prism' Strategy ()
_AsyncPool =
  (() -> Strategy)
-> (Strategy -> Either Strategy ()) -> Prism' Strategy ()
forall b t s a. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism
    (Strategy -> () -> Strategy
forall a b. a -> b -> a
const Strategy
AsyncPool)
    ( \case
        Strategy
AsyncPool -> () -> Either Strategy ()
forall a b. b -> Either a b
Right ()
        Strategy
x -> Strategy -> Either Strategy ()
forall a b. a -> Either a b
Left Strategy
x
    )
{-# INLINE _AsyncPool #-}

-- | Default num paths for normal, full search.
--
-- @since 0.1
defaultNumPaths :: Positive Int
defaultNumPaths :: Positive Int
defaultNumPaths = Int -> Positive Int
forall a. a -> Positive a
UnsafePositive Int
10

-- | Default num paths for size search.
--
-- @since 0.1
defaultNumPathsSize :: Positive Int
defaultNumPathsSize :: Positive Int
defaultNumPathsSize = Int -> Positive Int
forall a. a -> Positive a
UnsafePositive Int
1

-- | @since 0.1
data Config = MkConfig
  { -- | Whether to search hidden files/directories.
    --
    -- @since 0.1
    Config -> Bool
searchAll :: !Bool,
    -- | The depth limit of our search. Note that we still need to fully
    -- traverse the file system to get accurate data; this argument merely
    -- affects what is reported i.e. any depths > d are implicitly included
    -- in parent directories, but not directly.
    Config -> Maybe Word16
maxDepth :: !(Maybe Word16),
    -- | Paths to skip.
    --
    -- @since 0.1
    Config -> HashSet OsPath
exclude :: !(HashSet OsPath),
    -- | Whether to limit our search to just files.
    --
    -- @since 0.1
    Config -> Bool
filesOnly :: !Bool,
    -- | If active, this flag ignores the size of the directory itself e.g.
    -- 4096 bytes on a typical ext4 filesystem.
    --
    -- @since 0.1
    Config -> Bool
ignoreDirIntrinsicSize :: !Bool,
    -- | The number of paths to return.
    --
    -- @since 0.1
    Config -> Maybe (Positive Int)
numPaths :: !(Maybe (Positive Int)),
    -- | If enabled, sorts by path name after the size. This makes the sort
    -- stable, at the cost of performance.
    --
    -- @since 0.1
    Config -> Bool
stableSort :: !Bool,
    -- | The search strategy.
    --
    -- @since 0.1
    Config -> Strategy
strategy :: !Strategy
  }
  deriving stock
    ( -- | @since 0.1
      Config -> Config -> Bool
(Config -> Config -> Bool)
-> (Config -> Config -> Bool) -> Eq Config
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Config -> Config -> Bool
== :: Config -> Config -> Bool
$c/= :: Config -> Config -> Bool
/= :: Config -> Config -> Bool
Eq,
      -- | @since 0.1
      Int -> Config -> ShowS
[Config] -> ShowS
Config -> [Char]
(Int -> Config -> ShowS)
-> (Config -> [Char]) -> ([Config] -> ShowS) -> Show Config
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Config -> ShowS
showsPrec :: Int -> Config -> ShowS
$cshow :: Config -> [Char]
show :: Config -> [Char]
$cshowList :: [Config] -> ShowS
showList :: [Config] -> ShowS
Show
    )

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ Bool, b ~ Bool) =>
  LabelOptic "searchAll" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (Bool -> Config) -> f Bool -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( \Bool
searchAll' ->
                Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                  Bool
searchAll'
                  Maybe Word16
_maxDepth
                  HashSet OsPath
_exclude
                  Bool
_filesOnly
                  Bool
_ignoreDirIntrinsicSize
                  Maybe (Positive Int)
_numPaths
                  Bool
_stableSort
                  Strategy
_strategy
            )
            (a -> f b
f a
Bool
_searchAll)
  {-# INLINE labelOptic #-}

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ Maybe Word16, b ~ Maybe Word16) =>
  LabelOptic "maxDepth" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (Maybe Word16 -> Config) -> f (Maybe Word16) -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( \Maybe Word16
maxDepth' ->
                Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                  Bool
_searchAll
                  Maybe Word16
maxDepth'
                  HashSet OsPath
_exclude
                  Bool
_filesOnly
                  Bool
_ignoreDirIntrinsicSize
                  Maybe (Positive Int)
_numPaths
                  Bool
_stableSort
                  Strategy
_strategy
            )
            (a -> f b
f a
Maybe Word16
_maxDepth)
  {-# INLINE labelOptic #-}

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ HashSet OsPath, b ~ HashSet OsPath) =>
  LabelOptic "exclude" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (HashSet OsPath -> Config) -> f (HashSet OsPath) -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( \HashSet OsPath
exclude' ->
                Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                  Bool
_searchAll
                  Maybe Word16
_maxDepth
                  HashSet OsPath
exclude'
                  Bool
_filesOnly
                  Bool
_ignoreDirIntrinsicSize
                  Maybe (Positive Int)
_numPaths
                  Bool
_stableSort
                  Strategy
_strategy
            )
            (a -> f b
f a
HashSet OsPath
_exclude)
  {-# INLINE labelOptic #-}

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ Bool, b ~ Bool) =>
  LabelOptic "filesOnly" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (Bool -> Config) -> f Bool -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( \Bool
filesOnly' ->
                Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                  Bool
_searchAll
                  Maybe Word16
_maxDepth
                  HashSet OsPath
_exclude
                  Bool
filesOnly'
                  Bool
_ignoreDirIntrinsicSize
                  Maybe (Positive Int)
_numPaths
                  Bool
_stableSort
                  Strategy
_strategy
            )
            (a -> f b
f a
Bool
_filesOnly)
  {-# INLINE labelOptic #-}

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ Bool, b ~ Bool) =>
  LabelOptic "ignoreDirIntrinsicSize" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (Bool -> Config) -> f Bool -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( \Bool
ignoreDirIntrinsicSize' ->
                Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                  Bool
_searchAll
                  Maybe Word16
_maxDepth
                  HashSet OsPath
_exclude
                  Bool
_filesOnly
                  Bool
ignoreDirIntrinsicSize'
                  Maybe (Positive Int)
_numPaths
                  Bool
_stableSort
                  Strategy
_strategy
            )
            (a -> f b
f a
Bool
_ignoreDirIntrinsicSize)
  {-# INLINE labelOptic #-}

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ Maybe (Positive Int), b ~ Maybe (Positive Int)) =>
  LabelOptic "numPaths" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (Maybe (Positive Int) -> Config)
-> f (Maybe (Positive Int)) -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( \Maybe (Positive Int)
numPaths' ->
                Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                  Bool
_searchAll
                  Maybe Word16
_maxDepth
                  HashSet OsPath
_exclude
                  Bool
_filesOnly
                  Bool
_ignoreDirIntrinsicSize
                  Maybe (Positive Int)
numPaths'
                  Bool
_stableSort
                  Strategy
_strategy
            )
            (a -> f b
f a
Maybe (Positive Int)
_numPaths)
  {-# INLINE labelOptic #-}

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ Bool, b ~ Bool) =>
  LabelOptic "stableSort" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (Bool -> Config) -> f Bool -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( \Bool
stableSort' ->
                Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                  Bool
_searchAll
                  Maybe Word16
_maxDepth
                  HashSet OsPath
_exclude
                  Bool
_filesOnly
                  Bool
_ignoreDirIntrinsicSize
                  Maybe (Positive Int)
_numPaths
                  Bool
stableSort'
                  Strategy
_strategy
            )
            (a -> f b
f a
Bool
_stableSort)
  {-# INLINE labelOptic #-}

-- | @since 0.1
instance
  (k ~ A_Lens, a ~ Strategy, b ~ Strategy) =>
  LabelOptic "strategy" k Config Config a b
  where
  labelOptic :: Optic k NoIx Config Config a b
labelOptic =
    LensVL Config Config a b -> Lens Config Config a b
forall s t a b. LensVL s t a b -> Lens s t a b
lensVL (LensVL Config Config a b -> Lens Config Config a b)
-> LensVL Config Config a b -> Lens Config Config a b
forall a b. (a -> b) -> a -> b
$
      \a -> f b
f
       ( MkConfig
           Bool
_searchAll
           Maybe Word16
_maxDepth
           HashSet OsPath
_exclude
           Bool
_filesOnly
           Bool
_ignoreDirIntrinsicSize
           Maybe (Positive Int)
_numPaths
           Bool
_stableSort
           Strategy
_strategy
         ) ->
          (Strategy -> Config) -> f Strategy -> f Config
forall a b. (a -> b) -> f a -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
            ( Bool
-> Maybe Word16
-> HashSet OsPath
-> Bool
-> Bool
-> Maybe (Positive Int)
-> Bool
-> Strategy
-> Config
MkConfig
                Bool
_searchAll
                Maybe Word16
_maxDepth
                HashSet OsPath
_exclude
                Bool
_filesOnly
                Bool
_ignoreDirIntrinsicSize
                Maybe (Positive Int)
_numPaths
                Bool
_stableSort
            )
            (a -> f b
f a
Strategy
_strategy)
  {-# INLINE labelOptic #-}

-- |
--
-- @
-- MkConfig
--   { searchAll = True,
--     maxDepth = Nothing,
--     exclude = [],
--     filesOnly = False,
--     ignoreDirIntrinsicSize = False,
--     numPaths = Just 10,
--     strategy = Async
--   }
-- @
--
-- @since 0.1
defaultConfig :: Config
defaultConfig :: Config
defaultConfig =
  MkConfig
    { searchAll :: Bool
searchAll = Bool
True,
      maxDepth :: Maybe Word16
maxDepth = Maybe Word16
forall a. Maybe a
Nothing,
      exclude :: HashSet OsPath
exclude = HashSet OsPath
forall a. HashSet a
HSet.empty,
      filesOnly :: Bool
filesOnly = Bool
False,
      ignoreDirIntrinsicSize :: Bool
ignoreDirIntrinsicSize = Bool
False,
      numPaths :: Maybe (Positive Int)
numPaths = Positive Int -> Maybe (Positive Int)
forall a. a -> Maybe a
Just Positive Int
defaultNumPaths,
      stableSort :: Bool
stableSort = Bool
False,
      strategy :: Strategy
strategy = Strategy
Async
    }